I am linking two MongoDB collections, for example, Aand Bby storing the B'sObjectId in A(say A.bId). How to find all instances Awhere it is bIdno longer valid (the corresponding one Bdoes not exist)?
A
B
B's
A.bId
bId
Based on the answers and the official documentation , it’s clear that MongoDB doesn’t force links. Therefore, I need an effective way to find invalid links A'sto clear them.
A's
Aand B- large collections, so I would like to:
B.id's
$nin
B.findById(A.bId)
MongoDB - . , . .
, . , , . . , .
, , A , . script A.
: " () A ?" , : " , B ". post-delete A. , .
, , , , , , MongoDB. , , .
Source: https://habr.com/ru/post/1589529/More articles:Trying to pass parameters from the master template to the child - jsonReflectionException - DatabaseSeeder class does not exist, Laravel Seeder - phpRewrite the query string to another query string - urlHow to find the equivalent of broken "foreign key" relationships? - mongodbКак вы используете python-daemon так, как это диктует документация? - pythonHow to find items in collections that are not in another collection with MongoDB - databaseRemoving a DOM element from an element that is created by an external script - javascriptAngularJS dropdown with treeview - angularjsHow to check if Clojure code is running inside REPL? - clojureDisable variable information in chrome debugger - google-chrome-devtoolsAll Articles