Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add update by example API #94

Open
greenlaw110 opened this issue Jul 19, 2012 · 0 comments
Open

Add update by example API #94

greenlaw110 opened this issue Jul 19, 2012 · 0 comments
Labels

Comments

@greenlaw110
Copy link
Collaborator

Add an "update by example API" so that the problem described in http://stackoverflow.com/questions/10663633/in-play-morphia-how-do-i-manage-updates?rq=1 could be solved by:

static public void Update(JsonObject body){
   Gson gs = new GsonBuilder().create();
   MyModel m = gs.fromJson(body, MyModel.class);
   // this call erases "privatefield" from the document: m.save()
   m.update(); // this update existing data with new fields only
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant