-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Server
-
Labels:
-
2
In strict API mode $text queries are failing becaue Text indexes weren't included into the scope of the Stable API:
$ mongosh "mongodb+srv://cluster1.fu4ty.mongodb.net" --apiVersion 1 --username admin --apiStrict Enter password: *** Current Mongosh Log ID: 646828b773b69b1d0be1e5fd Connecting to: mongodb+srv://<credentials>@cluster1.fu4ty.mongodb.net/?appName=mongosh+1.6.0 Using MongoDB: (API Version 1) Using Mongosh: 1.6.0 For mongosh info see: https://docs.mongodb.com/mongodb-shell/ Warning: Found ~/.mongorc.js, but not ~/.mongoshrc.js. ~/.mongorc.js will not be loaded. You may want to copy or rename ~/.mongorc.js to ~/.mongoshrc.js. Atlas atlas-11qc0x-shard-0 [primary] test> use test already on db test Atlas atlas-11qc0x-shard-0 [primary] test> db.reviews.find( { $text: { $search: "coffee -shop" } } ) Uncaught: MongoServerError: error processing query: ns=test.reviewsTree: TEXT : query=coffee -shop, language=english, caseSensitive=0, diacriticSensitive=0, tag=NULL Sort: {} Proj: {} planner returned error :: caused by :: need exactly one text index for $text query
The documentation should explicitly state this limitation.
(Currently this can only be inferred from the line that says that text indexes can't be created)