I'm working with a js framework called spine. The framework can do all crud operations through REST api(like backbone). When I get a create request to my controller, I get a model data that has an id field from client side, I know that I'm in a create request so I should create a new record but mongo think this record already exists(because of the id field) and invokes update instead of insert. Is there a way to solve this issue? I want client side to create this temporal id's but when calls server side create this id should be ignored.
some code:
#in my_controller
def create
@model= Model.new(params[:modelData]) #model data is name=>"x", _id=>"c-0"
@model.save
when save is called mongo do update, so next create will override this record.