Hello everyone,
Today I'm trying to navigate mongoose queries.
Imagine we have a collection like this:
[
{letter: "A", name: "Books", action: "read"},
{letter: "B", name: "Notebook", action: "write"},
{letter: "C", name: "Camera", action: "take photos"},
{letter: "D", name: "Pencil", action: "draw"}
]
I want to extract a subset containing the documents with names: "Books" and "Pencil".
The expected output should be:
[
{letter: "A", name: "Books", action: "read"},
{letter: "D", name: "Pencil", action: "draw"}
]
Can this be achieved using the "find()" method?