MongoDB Search Strategy
See original GitHub issueIs your feature request related to a problem? Please describe.
Due to the DefaultSeachPlugin
within @vendure/core
not having an implemented MongoDB Search Strategy, even if I configure VendureConfig
correctly using the TypeORM MongoDB Connection settings (as mentioned in https://github.com/vendure-ecommerce/vendure/issues/132#issuecomment-517197724 from 2019), I still receive the following error.
sean@pop-os:~/temp/e2e-vendure/project-name$ npm run start
> project-name@0.1.0 start
> concurrently yarn:run:*
yarn run v1.22.17
yarn run v1.22.17
$ ts-node ./src/index-worker.ts
$ ts-node ./src/index.ts
[run:worker] info 01/11/21, 16:43 - [Vendure Worker] Bootstrapping Vendure Worker (pid: 6183)...
[run:server] info 01/11/21, 16:43 - [Vendure Server] Bootstrapping Vendure Server (pid: 6191)...
[run:worker] error 01/11/21, 16:43 - [ExceptionHandler] error.database-not-supported-by-default-search-plugin
[run:worker] Error: error.database-not-supported-by-default-search-plugin
[run:worker] at FulltextSearchService.setSearchStrategy (/home/sean/temp/e2e-vendure/project-name/node_modules/@vendure/core/src/plugin/default-search-plugin/fulltext-search.service.ts:125:23)
[run:worker] at new FulltextSearchService (/home/sean/temp/e2e-vendure/project-name/node_modules/@vendure/core/src/plugin/default-search-plugin/fulltext-search.service.ts:44:14)
[run:worker] at Injector.instantiateClass (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/injector.js:286:19)
[run:worker] at callback (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/injector.js:42:41)
[run:worker] at processTicksAndRejections (internal/process/task_queues.js:95:5)
[run:worker] at async Injector.resolveConstructorParams (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/injector.js:114:24)
[run:worker] at async Injector.loadInstance (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/injector.js:46:9)
[run:worker] at async Injector.loadProvider (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/injector.js:68:9)
[run:worker] at async Promise.all (index 3)
[run:worker] at async InstanceLoader.createInstancesOfProviders (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/instance-loader.js:43:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[run:worker] yarn run run:worker exited with code 1
[run:server] error 01/11/21, 16:43 - [ExceptionHandler] error.database-not-supported-by-default-search-plugin
[run:server] Error: error.database-not-supported-by-default-search-plugin
[run:server] at FulltextSearchService.setSearchStrategy (/home/sean/temp/e2e-vendure/project-name/node_modules/@vendure/core/src/plugin/default-search-plugin/fulltext-search.service.ts:125:23)
[run:server] at new FulltextSearchService (/home/sean/temp/e2e-vendure/project-name/node_modules/@vendure/core/src/plugin/default-search-plugin/fulltext-search.service.ts:44:14)
[run:server] at Injector.instantiateClass (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/injector.js:286:19)
[run:server] at callback (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/injector.js:42:41)
[run:server] at processTicksAndRejections (internal/process/task_queues.js:95:5)
[run:server] at async Injector.resolveConstructorParams (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/injector.js:114:24)
[run:server] at async Injector.loadInstance (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/injector.js:46:9)
[run:server] at async Injector.loadProvider (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/injector.js:68:9)
[run:server] at async Promise.all (index 3)
[run:server] at async InstanceLoader.createInstancesOfProviders (/home/sean/temp/e2e-vendure/project-name/node_modules/@nestjs/core/injector/instance-loader.js:43:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[run:server] yarn run run:server exited with code 1
sean@pop-os:~/temp/e2e-vendure/project-name$
Looking at #505 I could modify the following line so I no longer get the error.database-not-supported-by-default-search-plugin
error, although that doesn’t add the functionality magically.
Describe the solution you’d like
A MongoDB Search Strategy be implemented within @vendure/core
’s DefaultSeachPlugin
.
Describe alternatives you’ve considered Being pointed to an already existing implementation of this, or a neat work around. Failing all of the above, I can just hackily change the switch case.
Additional context N/A
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
If you know what either TypeORM doesn’t cover, or what you’ve had to write on top of / extend TypeORM for custom functions (like the Search Strategies, where you’ve written implementations for
mariadb
,better-sqlite3
andpostgres
), I would be interested in looking into what it would take to make MongoDB reach the minimum compatibility level to function.Just had a look through the TypeORM issues and it seems like the MongoDB driver does not support:
which are absolute show-stoppers right there. Unless those features get proper support, there’s basically no possibility that Vendure will work with Mongo.