gstore-node
Search…
populate()
This methods allows you to fetch all the references entities declared on your Schema.
It accepts two optional arguments:
    references (string or Array<string>) One or multiple references to fetch (e.g. 'author' or ['author', 'address'])
    properties (string or Array<string>) The properties to return from the fetched reference entities.
1
entity.populate('user', 'email')
2
.populate('address') // Calls can be chained
3
.then(() => {
4
// entity.user.email has been fetched
5
// entity.address will has been fetched
6
});
Copied!
For a detailed explanation on how populate() works, refer to the documentation.
Last modified 2yr ago
Copy link