linvodb3 icon indicating copy to clipboard operation
linvodb3 copied to clipboard

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

Open oumad opened this issue 8 years ago • 3 comments

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.

oumad avatar Jun 21 '17 13:06 oumad

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.

Darkbladecr avatar Jul 15 '17 12:07 Darkbladecr

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

keless avatar Jul 17 '19 06:07 keless

Hey,

This project is no longer maintained

Anyway, this looks like expected behavior to me

The reason push fails is that the object you’re pushing does not adhere to your own schema. It needs to have the shots property

On Wed, 17 Jul 2019 at 07:01, Paul Zirkle [email protected] wrote:

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Ivshti/linvodb3/issues/79?email_source=notifications&email_token=AAJQTDJB3VAVWJNT7ZHCIYTP72YTJA5CNFSM4DQEAIF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2DECIY#issuecomment-512114979, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJQTDO2TNWRZGHHJ6RCES3P72YTJANCNFSM4DQEAIFQ .

--

[image: photo] Ivo Georgiev Founder & CEO, Stremio

https://www.stremio.com http://www.stremio.com

GPG: AC692BE9EB6E024B5C58A8EAC1E94996BC56BACE http://www.stremio.com http://www.facebook.com/stremio/ http://twitter.com/stremio http://www.instagram.com/stremioofficial/ http://www.reddit.com/r/Stremio/ http://blog.stremio.com/

https://play.google.com/store/apps/details?id=com.stremio.beta https://itunes.apple.com/us/app/stremio/id987232010?mt=8

Ivshti avatar Jul 17 '19 19:07 Ivshti