node.js - How do I save embeded docs without error "key $__ must not start with '$'(…)" while using devtool and Mongoose 4.x -


i in process of upgrading mongoose 3.8.22 4.x seemed working nicely until started debugging issue devtool have been using without issue month while using mongoose 3.8.22.

while running node server not encounter errors or problems when running server using npm package 'devtool' save includes sub-documents fails following error:

"key $__ must not start '$'(…)".

has experienced issue or found fix?

as example:

i start 2 schemas, person , customopts

var customoptions = new schema({     optstype: {         type: string,         required: true     },     someoption: {         type: boolean,         required: true     } }); var person = new schema({     name: {         type: string,         required: true     },     customopts: [customoptions] }); 

next create x new customopts , add them new person

var newopts = new locator.db.customoptions({     optstype: 'some_opts',     someoption: true, });  var newperson = new locator.db.person({     name: 'steve',     customopts: [newopts] }); 

when using newperson.save() have no issues on node devtool throws error long have newopts in customopts array


Comments

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -