correct update
authorymh <ymh.work@gmail.com>
Thu, 16 Aug 2012 16:47:15 +0200
changeset 17 f2ede9ded433
parent 16 399690e161cc
child 19 d49b927bfe62
correct update
server/src/main/java/org/iri_research/renkan/rest/ProjectsResource.java
--- a/server/src/main/java/org/iri_research/renkan/rest/ProjectsResource.java	Thu Aug 16 16:04:54 2012 +0200
+++ b/server/src/main/java/org/iri_research/renkan/rest/ProjectsResource.java	Thu Aug 16 16:47:15 2012 +0200
@@ -19,6 +19,7 @@
 
 import org.iri_research.renkan.db.MongoConnectionManager;
 
+import com.mongodb.BasicDBObject;
 import com.mongodb.DB;
 import com.mongodb.DBCollection;
 import com.mongodb.DBObject;
@@ -222,7 +223,7 @@
 		
 		obj.put("_id", newProjectId);
 		
-		WriteResult res = projectCollection.insert(obj);
+		WriteResult res = projectCollection.update(new BasicDBObject("_id", newProjectId), obj, true, false);
 		
 		if(res.getLastError().ok()) {
 			if(projectId == null) {