Skip to content

Regex not working #190

@pesseyjulien

Description

@pesseyjulien

Hi,

Trying to find by regex but it's not working, here is my query (which works on cli) :

code :

data.query = {cleanName: {$regex: song}}
await this.app.service('track').find(data);

log:

{
  query: { cleanName: { '$regex': 'test' } },
  paginate: { default: 10000 }
}

In My track.class.js

 app.get('mongoClient').then(db => {
      this.Model = db.collection('track')
      this.whitelist = ['$regex']
    });

Any idea why ?

Thanks in advance,
Julien

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions