Rapidfacture / mongoose-multi

NPM Module: Create Mongoose connections to severals DBs; short, mongoDB like syntax for requests.
12 stars 4 forks source link

embedded documents throwing some strange error #13

Open mergingseas opened 2 years ago

mergingseas commented 2 years ago

Hi, I am getting this error when I have embedded documents. Screen Shot 2022-02-27 at 11 39 41 AM

my schema file looks like this where I have a labelSchema and customerSchema has a field which is array of labelSchema: Screen Shot 2022-02-27 at 11 41 39 AM

when I try to create a document of type customer in application database I get the error above, this has something to do with embedded schema for embedded docs, if I just defined the CustomerSchema with labels as nested path instead

Screen Shot 2022-02-27 at 11 42 47 AM

it works,

code to try to create a customer document is this: Screen Shot 2022-02-27 at 11 43 47 AM