findByElement()

You can find a data on Schema by element

Syntax

User.findByElement(element,callback?)
  • element type is any and required

  • Callback; Callback is a function and not required.

Example

const element = { name:"John" }
User.findByElement(element,(callback) => {
console.log(callback)
/*
{
  id: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
  name: 'John'
  surname: 'Doe',
  age: 18,
  updatedAt: 1970-01-01T00:00:00.000Z,
  createdAt: 1970-01-01T00:00:00.000Z
}
*/
})

Last updated