In my instance of raven3.5 I have a collection and some documents have an extra property due to a change in the document structure. Now I need to query on that property but many older documents don't have it.
How can I patch the collection and add the property to documents that don't have it? Or create a query that will get the documents that don't have the specific property?
Thanks.
The below is what I know works for RavenDB Server 4.2 and up:
Option 1 - using static index
Create a static index ('MyIndex') with the following map method:
Then query the index as follows:
Return all 'Items' that do not have 'Name':
Option 2 - using auto-index:
First, run the following query which will 'create' the auto-index for you:
After that, you can query the following to get results:
=================================================
A patch script is made up of the query part and the update part
So use the following to add the missing property to docs that don't have it: