I tried to establish some document references in the no-sql database MongoDb.
It turns out that the document reference DbRef is kind of an outdated features and that it is poorly supported by available tooling (for example Navicat does not allow to click on DbRef to resolve it).
I would need to run custom queries on the client to resolve document references. The drivers do not seem to support a way to resolve references / perform joins in a single step.
As a workaround I could use:
Mongoose with its populate method (runs two separate queries in the background)
The combination of manual reference, $lookup and $unwind. $lookup won't work with sharded collections and always returns its result as array.
Also see the links below.
=> I am wondering if MongDb is the right tool for me or if there is a better alternative out there.
Requirements:
- No-Sql database
- Establish document references that can be resolved by queries/tools
- Programming language: Python or JavaScript
- Optional: allow to distribute/shard data over several cluster notes
Related: