Move/Add/Change/Delete API for single view

9 views
Skip to first unread message

Michael Salmon

unread,
Apr 17, 2015, 9:59:00 PM4/17/15
to couc...@googlegroups.com
Hi folks,

Was wondering if I can edit a view without deleting/readding the entire design document? Either through REST API or Python ideally but open to other interfaces. Right now when I change my indexes I have a script that reloads the design document but then it takes a long time to rebuild, taking my app server offline effectively while the indexes are rebuilt.

Thanks,
Michael

Volker Mische

unread,
Apr 19, 2015, 5:57:31 AM4/19/15
to couc...@googlegroups.com
Hi Michael,
what you could to is creating a separate design document with a
different name, but containing the updated views. Then trigger and
update (e.g. with a `stale=false` request) update. Once done, you can
upload the same definitions with the original name. This will make you
app work without any downtime.

This works because the view engine creates a hash of the contents of the
design documen, but doesn't include its name.

Cheers,
Volker

Michael Salmon

unread,
Apr 20, 2015, 1:31:48 PM4/20/15
to couc...@googlegroups.com
Hi Volker,

Thanks for the feedback.

So basically I need to manage this via separate design docs. Since I read that design docs are objects in the DB, it makes me wonder if there's a way to actually get the design docs from the DB as json and edit them directly like a normal document?

-Michael

Mark Nunberg

unread,
Apr 20, 2015, 1:39:08 PM4/20/15
to couc...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to couchbase+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages