From 2a201a5af9d0bad50c10676962ab52d661249c9e Mon Sep 17 00:00:00 2001 From: Matthias Oertel Date: Fri, 5 Jul 2019 15:53:38 +0200 Subject: [PATCH] do not store ids under id and _id when they are user provided --- .../com/prisma/api/connector/mongo/database/NodeActions.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/connectors/api-connector-mongo/src/main/scala/com/prisma/api/connector/mongo/database/NodeActions.scala b/server/connectors/api-connector-mongo/src/main/scala/com/prisma/api/connector/mongo/database/NodeActions.scala index 61785b5f5a..5533ab150f 100644 --- a/server/connectors/api-connector-mongo/src/main/scala/com/prisma/api/connector/mongo/database/NodeActions.scala +++ b/server/connectors/api-connector-mongo/src/main/scala/com/prisma/api/connector/mongo/database/NodeActions.scala @@ -123,7 +123,7 @@ trait NodeActions extends NodeSingleQueries { case (_, _) => NodeAddress.forId(mutaction.model, id) } - val nonListArgsWithId = nonListValues :+ ("_id", id) + val nonListArgsWithId = nonListValues.filter(p => p._1 != mutaction.model.idField_!.dbName) :+ ("_id", id) val (nestedCreateFields, childResults) = embeddedNestedCreateDocsAndResults(mutaction, currentParent) val doc = Document(nonListArgsWithId ++ listValues ++ inlineRelations) ++ nestedCreateFields