Get()

get({ q?: {}, skip?: number, limit?: number, project?: [], sort?: {} })

The noonjs client provides methods for retrieving records from the backend, supporting parameters such as q, limit, skip, project, and sort.

Retrieve All Documents

Fetches all documents from the "todos" collection.
const todos = await client.collection("todos").get();

Paginated Retrieval

Fetches a subset of documents, skipping the first 10 and limiting the result to 20.
const todos = await client.collection("todos").get({ skip: 10, limit: 20 });

Query with Condition

Retrieves documents where the "done" field exists.
const todos = await client.collection("todos").get({ q: { done: { $exists: true } } });

Retrieve Specific Properties

Fetches only specific fields (e.g., "title") from the "todos" collection.
const todos = await client.collection("todos").get({ project: "title" });

Sorted Retrieval

Fetches documents sorted by the "done" field in descending order.
const todos = await client.collection("todos").get({ sort: { done: -1 } });
Edit this page on Github
© 2025 kav3.com. Crafted with and dedication.