Skip to content

API reference

get

Retrieves a document from the given path.

Parameters

PropTypeDescription
pathstringThe document path.

Returns

  • Returns a promise that resolves to the document if found, or null if not found.

Example

js
const db = new Naro("myDatabase");

const user = await db.get("users/generated-id");
console.log(user);

// Output:
{ 
  id: "generated-id", 
  createdAt: 1696872345000,
  path: "users/generated-id",
  age: 30 
}

Released under the SSPL License.