Tuesday, May 13, 2008

Chaning the datatype

When we change the data type of a field, then the new data type will not reflected in old documents. To change the data type in the existing documents we have 2 options
1. Open and Save all the documents.
2. We can have background agent to do this.
Here is the logic,
  • Create an item for the existing field
  • Copy the items content
  • Delete the item
  • Create a new item for the same field (The new item will have the new data type)
  • Set the old value in the new item
  • Save the document.