I am trying out the eqJoin function for the first time, and was running into an error when trying to combine the left and right objects in the mapper function.
When I tried to use object spread syntax to add a field to left from right:
Error: Document is already in collection, please use update()
at Collection.add (/Users/jasonhostetter/dev/pacsbin-project/rigel/node_modules/lokijs/src/lokijs.js:5951:15)
at Collection.insertOne (/Users/jasonhostetter/dev/pacsbin-project/rigel/node_modules/lokijs/src/lokijs.js:5738:17)
at Collection.insert (/Users/jasonhostetter/dev/pacsbin-project/rigel/node_modules/lokijs/src/lokijs.js:5686:20)
at Resultset.eqJoin (/Users/jasonhostetter/dev/pacsbin-project/rigel/node_modules/lokijs/src/lokijs.js:3961:23)
I figured out that it depends on whether I am trying to pass $loki as a field in the returned object.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am trying out the eqJoin function for the first time, and was running into an error when trying to combine the left and right objects in the mapper function.
When I tried to use object spread syntax to add a field to
left
fromright
:I get the error:
I figured out that it depends on whether I am trying to pass
$loki
as a field in the returned object.This gives an error:
This works as expected:
Is there a way to just add a field or fields to the left object of the join and return it?