How to hide _id from this query, i use express node.js ?
i have this query and i make an API but i want hide ths _id.
this is the query :
router.get("/", (req, res) => {
VerbsDE.find({}, { _id: 0 })
.limit(1)
.then(verbs => {
res.send(verbs);
});
});
////////////////////////////////////////////////// this is the collection :
[
{
Indicative: {
Present: [
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
}
],
Perfect: [
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
}
],
Past: [
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
}
],
Pluperfect: [
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
}
],
Future_I: [
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
}
],
Future_II: [
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
}
]
},
Imperative: {
Worte: [
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
},
{
_id: "5bb9009249efde355376ad29",
pron: "xxx",
verb: "xxx xxx xxx"
}
]
},
_id: "5bb9009249efde355376ad23",
verbName: "abbilden",
__v: 0
}
];
I tried to hide the _id , but every time I made mistakes, I wanted to fetch the data but not with Id.