couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilbert B Garza" <>
Subject Re: Renaming document attributes
Date Fri, 25 Jul 2008 17:28:54 GMT
On Wed, Jul 23, 2008 at 2:41 PM, Paul Carey <> wrote:

> I guess I was thinking along the lines of what to do if, say, hundreds
> of thousands of documents contained an attribute to be renamed.
> Copying the old attribute to the new one and saving would certainly
> work, but this would presumably take some time, during which views
> that referenced the attribute might return inconsistent data. At some
> point all views that reference the old attribute would need to be
> updated with the new attribute name.
> As I say, I have no need for this myself, at least not now. My
> question was mostly motivated by curiosity.
> Paul

You could copy all the old attribute values into the new renamed attribute,
save all the documents, and read it from the database that way. If you're
concerned about disk space after that, you can start deleting the old
attribute from all the documents without worrying about data inconsistency.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message