I'm inserting a nested document in mongo using mongoose.
{
"_id": "56dea517302071934eae7913",
"name": "abc",
"counter": [
{
"name": "xyz",
"count": 1,
}
]
}
But On querying Mongo I get doc like:
{
"_id": "56dea517302071934eae7913",
"__v": 0 //extra field
"name": "abc",
"counter": [
{
"name": "xyz",
"count": 1,
}
]
}
Due to the extra "__v"
field in counter array object, the sha1 of the input and output does't match.
Is there any way to prevent it from happening? Or any other way to check data integrity?