graphql-compose / graphql-compose-mongoose

Mongoose model converter to GraphQL types with resolvers for graphql-compose https://github.com/nodkz/graphql-compose
MIT License
707 stars 94 forks source link

Create text search queries #215

Open zkBounty opened 4 years ago

zkBounty commented 4 years ago

I'm unable to figure out how to create a graphql query for triggering basic mongodb fulltext search.

I have a single field in my mongoose schema as below.

const userSchema = new Schema({ name: String ....

and I have a text index on it.

userSchema.index({ name: 'text'});

And while I do see the index being constructed in my mongodb, I can't see anything in my graphql playground that would resolve to a $text query.

I was unable to find this in the documentation for graphql-compose-mongoose either. Maybe I'm missing something?

eric-hc commented 4 years ago

Any updates @zkBounty? I have also been looking for documentation or examples to implement a filter similar to what is outlined here, but have been struggling.

Edit: This post might have been you, only thing I have found so far