rql with nested data

70 views
Skip to first unread message

Brent Mills

unread,
Aug 21, 2019, 7:08:11 AM8/21/19
to RavenDB - 2nd generation document database
We've recently upgraded to raven 4 from raven 3 and I'm struggling to get to grips with rql for patching. Specifically how to search a nested collection as I haven't seen any examples in the help text that cover nersted collections . For example,  how would I write this Raven 3 patch in RQL?


for (var t = 0; t < this.TeamCategories.length; t++) {
   
for (var v = 0; v < this.TeamCategories[t].Venues.length; v++) {
       
PutDocument(this.TeamCategories[t].Venues[v],
           
{
               
Address: this.TeamCategories[t].Venues[v].Address                
           
},
           
{
               
'Raven-Entity-Name': 'Venues'
           
});
   
}
}



Oren Eini (Ayende Rahien)

unread,
Aug 21, 2019, 9:21:07 AM8/21/19
to ravendb
for (var t = 0; t < this.TeamCategories.length; t++) {
    for (var v = 0; v < this.TeamCategories[t].Venues.length; v++) {
    var docId = this.TeamCategories[t].Venues[v];
        put(docId, {

                Address: this.TeamCategories[t].Venues[v].Address,
                "@metadata": {
                "@collection": 'Venues'
                }
        });
    }
}

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/9c922998-9ec5-4b77-b735-f37e453dbf1a%40googlegroups.com.


--
Oren Eini
CEO   /   Hibernating Rhinos LTD
Skype:  ayenderahien
Support:  sup...@ravendb.net

Brent Mills

unread,
Aug 23, 2019, 6:38:42 AM8/23/19
to RavenDB - 2nd generation document database
Thanks Oren, stupidly I didn't include which collection this is running on. I tried amending your suggestion to the following, but it didn't work:

from CommunityDocuments
update
{

Oren Eini (Ayende Rahien)

unread,
Aug 27, 2019, 10:03:11 AM8/27/19
to ravendb
What happens when you run this?

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages