GenAI-Showcase icon indicating copy to clipboard operation
GenAI-Showcase copied to clipboard

Error using nodejs to create vector search index on mongodb 7

Open databloom opened this issue 1 year ago • 2 comments

I'm porting a RAG pipeline from GenAI-Showcase that was using Atlas to a mongdb local instance to the LLM.

Following https://www.mongodb.com/docs/compass/current/indexes/create-vector-search-index/, I installed node >16.4 and npm mongodb module but it appears that the installed mongodb module is missing a createSearchIndexes context.

root@ad93b157e668:/GenAI-Showcase/mongodb-vector-search# node atlas-vector-search-quick-start.js MongoServerError: no such command: 'createSearchIndexes' at Connection.sendCommand (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/cmap/connection.js:297:27) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Connection.command (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/cmap/connection.js:325:26) at async Server.command (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/sdam/server.js:166:24) at async CreateSearchIndexesOperation.execute (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/operations/search_indexes/create.js:21:21) at async executeOperation (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/operations/execute_operation.js:112:20) at async Collection.createSearchIndexes (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/collection.js:609:16) at async Collection.createSearchIndex (/GenAI-Showcase/mongodb-vector-search/node_modules/mongodb/lib/collection.js:596:25) at async run (/GenAI-Showcase/mongodb-vector-search/atlas-vector-search-quick-start.js:30:21) { errorResponse: { ok: 0, errmsg: "no such command: 'createSearchIndexes'", code: 59, codeName: 'CommandNotFound' }, ok: 0, code: 59, codeName: 'CommandNotFound', [Symbol(errorLabels)]: Set(0) {} }

Does mongodb 7.0 support vector search index definition ? Is Atlas your only offering that supports vector search ?

databloom avatar Jun 25 '24 18:06 databloom

Hello @databloom ,

At the moment only Atlas support the search indexes. Having said that, in the near future it will be available in community and enterprise, stay tuned.

If you just want to test out this notebook you can use a local atlas deployment for testing:

https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-local-cloud/

Pash10g avatar Sep 19 '24 10:09 Pash10g

You can also use:

docker run -p 27017:27017 mongodb/mongodb-atlas-local

ranfysvalle02 avatar Dec 07 '24 03:12 ranfysvalle02