find
This method can be used to find nodes, and maps to the underlying schema Queries.
Returns a Promise
which resolvers to an array of objects matching the type of the Model.
Example
To find all user nodes in the database:
const User = ogm.model("User");
const users = await User.find();
To find users with name "Jane Smith":
const User = ogm.model("User");
const users = await User.find({ where: { name: "Jane Smith" }});
Arguments
Name and Type | Description |
---|---|
|
A JavaScript object representation of the GraphQL |
|
A JavaScript object representation of the GraphQL |
|
Selection set for the Mutation, see Selection Set for more information. |
|
The |
|
The |
|
The |
Was this page helpful?