db-local
  • Introduction
  • Getting Started
  • Schema
  • Methods
    • .find()
      • References
      • Filters
    • .create()
    • .update()
    • .remove()
Powered by GitBook
On this page

Was this helpful?

  1. Methods

.find()

Parameter

Description

Returns

Description

Object

The data object that was sought

Array

Returns the entire database if an id is not passed in find

​find(<Query>)

// All below works
User.find((obj) => obj._id === 1)
User.find({ _id: 1 })
User.find({ username: "lennart" })
User.find(1)

// {
//   _id: 1, 
//   username: "lennart"
// }

If the id is not passed:

User.find() // [{ _id: 1, username: "lennart" }]

PreviousSchemaNextReferences

Last updated 3 years ago

Was this helpful?

| | |

In case of a specific search, use the or a with the parameters you are looking for in the document

Object
String
Number​
Function
Object
Function