Add extra column/field to RavenDB collection via RQL in Raven Studio

强颜欢笑 提交于 2020-05-15 07:44:29

问题


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 !


回答1:


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



来源:https://stackoverflow.com/questions/60413448/add-extra-column-field-to-ravendb-collection-via-rql-in-raven-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!