This is an extension to loopback-connector-mongodb ( https://github.com/strongloop/loopback-connector-mongodb)v4.0.0
This project is changed from original project for
- To query Mongo database to perform Groupby and aggregation operations. This is very specific to Oe-cloud.
Note: Test cases may not work.
Please refer loopback documentation at Github.
The connector can allow developers to provide their own id generation logic during new record creation. To enable this we need to do the following:
- Use the customized datasources config file (e.g.
idGenerateFnto the following a function which takes model name as first argument, and, the data (or payload) as the second argument. The function should return a id value or
undefined. If the latter, the value of the property will default to whatever is defined in the database/table/field. The context of this function will be the connector instance itself.
For troubleshooting, it may be required to see the queries
issued by the connector. Two things are required. (a) add
true in the datasource connector properties in
the main application, and, (b) set the
A general recommendation here would be set the
property based on reading the environment variable via nodejs
process.env.DEBUG). This way we only need to set the
environment variable prior to startup.