If you have subdownment arrays, then Mongo automatically creates an id for every one Example: < "Value"), {_id: "unwanted id", field: "value"}]}} Is there a way to make the merge not an ID for the objects within an array? It's easy, you can define it in subschema:
< Code> var mongoose = require ("mongoose"); Var subscema = Mongoose Sema ({// your subschema content}, {_id: false}); Var schema = mongos Shma ({// schema content sub-sachema collection: [subscema]}); Var model = mongos Model ('tablaanem', schema);
No comments:
Post a Comment