Ottoman Tutorial for node.js

I’m trying to create a CRUD with ottoman there is not much tutorials on ottoman for node.js + many results are for ottoman empire anyway,it would be really helpful to add tutorials for node.js + ottoman here.

PS: i have seen bikeShop example


How about this one?

P.S. Twas the first hit when I Googled; “Couchbase Ottoman Tutorial”. Please try and google first.

Thanks but it’s the bikeshop-cb example as mentioned above.

I couldn’t find any example for removing or updating documents in ottoman,i Googled a lot.

Great that you’re interested in Ottoman! It’s more of a project stage right now and we do want to enhance it soon. For the delete question, maybe @brett19 or @tgreenstein can point you to something?

I just had a quick look at the implementation, and I didn’t see anything obvious.

One other thing, might be useful to understand your use case a bit more. What’s the scenario and how would you want this to work ideally?

Hey man,you mean the implementation of ottoman?

I want to work with Couchbase instead of MongoDB and for that reason i need an ODM.

What i have in mind is to do all the CRUD tasks with Couchbase and to know what i can do with Ottoman and what have to do without it.

Right now looks like Ottoman is focused on creating models and not much on tasks like updating or deleting right? and i have to do it with Couchbase instead.

Hey @Dr.MJ,

In order to update an ottoman object, you simply update the fields you wish to change on the instance and call the save(callback) method to save those changes. In addition to this, removal of the object is possible by calling the instances remove(callback) method.

Cheers, Brett

if I want to change the whole referenced object, what should I do? If I just change its key I have an error “The Key of the object has changed”. Tnx

So from this answer, it implies that I can’t set all the fields at once, e.g. if I am doing a PATCH request, but I have to set each field in the model with the data, then save?

Handling ‘bulk’ data would be an ideal scenario.