Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't use push on a schema with an array of objects #79

Open
oumad opened this issue Jun 21, 2017 · 3 comments
Open

I can't use push on a schema with an array of objects #79

oumad opened this issue Jun 21, 2017 · 3 comments

Comments

@oumad
Copy link

oumad commented Jun 21, 2017

My schema looks like this :

var Projects = new LinvoDB("projects",{ projects : [{ name :String, shots : [{ name : String, order : Number, versions :[{ name:String, frames : [], comments :[{ content : String, user :String, date:Date }] }] }] }] }, { filename :'interface/db/newDB' }) var p = new Projects();

When I do :
p.projects.push({'name':project})

it doesn't work, the p.projects remains empty array.
The push works on array items but not objects only with the LinvoDB schema. Because I also manually created another normal object and when I try to use push the same way it works. It looks like this :
var mydb = { projects : [{ name :'myProject', shots : [{ name : 'shot_01', order : 0, versions :[{ name:"v01", frames : [], comments :[{ comment : 'blablabla', user :'username', date:'12/12/12' }] }] }] }] }

The mydb.projects.push({'name':project}); works perfectly in this case.

@Darkbladecr
Copy link

I have the exact same issue, the only way I can get this to work is to remove the schema definition, which would not be worth doing.

@keless
Copy link

keless commented Jul 17, 2019

I'm hitting this issue-- been 2 years; any resolution?

@Ivshti
Copy link
Owner

Ivshti commented Jul 17, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants