Remove indexes using Ottoman


#1

Hi Guys,

We are trying to delete a user and when that user is deleted using remove() method from ottoman we also want to delete the indexes for that user. So how should we go about removing the indexes for a document. Also, when a document is deleted are these indexes automatically removed from the bucket. If not then how should we go about doing this?


#2

Hey @ajinkyaudgirkar,

Any referential document indices you have configured for a Model should be destroyed when the object itself is removed, however there was a bug in previous ottoman versions which did not allow this to happen. You should consider updating to the latest version.

Cheers, Brett


#3

Hi @brett19 ,

Thanks for your quick response.

I am already using the latest version of ottoman(v1.0.3), however the issue still persists and the referential document indices are not being removed. So how should we go about this?


#4

Hey @ajinkyaudgirkar,

Looks like we didn’t get that fix into a release just yet. You can pull the latest development version of Ottoman which includes this fix directly from our GitHub: https://github.com/couchbaselabs/node-ottoman.

Cheers, Brett


#5

Hey @brett19,

Thanks for your quick reply again.

Have cloned the repo and our issue for deleting index has been resolved.

Great work on ottoman! It’s an easy to use ODM for couchbase :slight_smile:

Cheers, Ajinkya!