I am developing a facebook application in Ruby on Rails using MongoDB as database.
This application is for bookmarking facebook links.
Now I am facing a problem with MongoDB. Due to its “fire and forget” property, I am getting lot of duplicate URLs. I am unable to check whether the data is inserted or not. When we insert records continuosly i am unable to check whether the data exist or not to avoid duplication. Before the insertion of URL, it is unable to check whether the URL already exists.
I am using MongoMapper and Rails
If you want to verify that data was inserted, you can use the :safe option, as such:
See http://mongomapper.com/documentation/plugins/safe.html
I’m not sure if this waits for the write to propagate to all cluster nodes. MongoDB supports this as well, but I’m not sure if Mongomapper does.