Hi Natapol,
The #save method is used for both creating and updating documents, so
something like the below code will update an existing document:
article = Article.find(id)
article.title = "New Title"
article.save
If this is raising an exception relating to duplicate data, then it
indicates that some other document in the collection already has that
value, violating the uniqueness index.
Regards,
Sam