Skip to content

Commit a120ea9

Browse files
committed
Fix isseu with uniqeness if item has an _id
1 parent 3b1d31d commit a120ea9

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

OpenFlow/src/DatabaseConnection.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ export class DatabaseConnection {
13671367
const arr = q.uniqeness.split(",");
13681368
arr.forEach(field => {
13691369
if (field.trim() !== "") {
1370-
query[field] = q.item[field];
1370+
query[field.trim()] = q.item[field.trim()];
13711371
}
13721372
});
13731373
} else {
@@ -1407,6 +1407,7 @@ export class DatabaseConnection {
14071407
q.result = uqres.result;
14081408
} else {
14091409
if (Config.log_updates) Logger.instanse.debug("[" + user.username + "][" + q.collectionname + "] InsertOrUpdateOne, Inserting as new in database");
1410+
delete q.item._id;
14101411
const ot_end = Logger.otel.startTimer();
14111412
q.result = await this.InsertOne(q.item, q.collectionname, q.w, q.j, q.jwt, span);
14121413
Logger.otel.endTimer(ot_end, DatabaseConnection.mongodb_insert, { collection: q.collectionname });

OpenFlowNodeRED/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/nodered",
3-
"version": "1.2.84",
3+
"version": "1.2.85",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.84
1+
1.2.85

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/openflow",
3-
"version": "1.2.84",
3+
"version": "1.2.85",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)