Hi,
I’m running mongosh (latest/greatest) from my Window 7 Pro PC against an Atlas-deployed db of mine (version 6.0.6 it says), to test the construction of Atlas Search indexes through mongosh.
I connected to the cluster and entered the shell, then went to the db and showed the collections, just fine.
I picked one collection and called
db.<collection name>.crateSearchIndex("test", {})
expecting some syntax errors, but also trying in any other way, I get
MongoServerError: command not found
Yet, if I try
db.<collection name>.crateSearchIndex
the function appears to be known, showing:
[Function: createSearchIndex] AsyncFunction {
apiVersions: [ 0, 0 ],
returnsPromise: true,
serverVersions: [ ‘6.0.0’, ‘999.999.999’ ],
topologies: [ ‘ReplSet’, ‘Sharded’, ‘LoadBalanced’, ‘Standalone’ ],
returnType: { type: ‘unknown’, attributes: {} },
deprecated: false,
platforms: [ ‘Compass’, ‘Browser’, ‘CLI’ ],
isDirectShellCommand: false,
acceptsRawInput: false,
shellCommandCompleter: undefined,
help: [Function (anonymous)] Help
}
As well as it appears in
db.<collection name>.crateSearchIndex.help()
which shows, among other things,
createSearchIndex Creates one search indexes on a collection
So if it’s “there” and in the help() list, why is it reporting a “not known” error when used?
The user I connect as has readWrite access to the db.
Thanks