graphql-compose-mongoose icon indicating copy to clipboard operation
graphql-compose-mongoose copied to clipboard

Create text search queries

Open zkBounty opened this issue 5 years ago • 1 comments

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?

zkBounty avatar Apr 03 '20 07:04 zkBounty

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

eric-hc avatar Oct 27 '20 19:10 eric-hc