You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, but you have the responsibility of defining these links and recovering them.
Say for instance you have a collection of 'parents' and a collection of 'children' with some simple properties like an Id and a Name. If you want to create a link, you would have to set your documents like this:
// adds a parent to the databasedb.collection('parents').add({id:0,name:"John"});// adds Lucie as a children of John (id=0 in this example)db.collection('children').add({id:0,name:"Lucie",parentId: 0});
To then retrieve them from the database, you would have to:
constjohn=db.collection('parents').doc({id=0}).get();// the following line returns all entries in the children collection that contain the parentId of 0.constjohnChildren=db.collection('children').doc({parentId:0}).get();
It's up to you then to do whatever you want with this data. ;)
I using localbase in a off-line project, and I have a question. Is It possible link a data in a collection with data in another collection?
The text was updated successfully, but these errors were encountered: