2

I'm trying to update the entire collection by adding an extra field to each entity. This doesn't do the trick:

from things 
as t
update 
{
    put( id(t), "NewField");
}

Can someone help out with the syntax please ?

Thanks !

Hiro Protagonist
  • 474
  • 3
  • 15

1 Answers1

4

Just do:

from things as t
update {
    t.nameOfNewField = "valueOfNewField"
}

See:

https://ravendb.net/learn/inside-ravendb-book/reader/4.0/2-zero-to-ravendb#patching-documents

Danielle
  • 3,324
  • 2
  • 18
  • 31