You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I've found what I think is a bug. In summary, when using setData to set the collection contents and there is an index, lookups using this index can return duplicate data.
vartestCol=db.collection('testCol');testCol.setData([{"a":1,"b":1},{"a":2,"b":2},{"a":3,"b":3}]);testCol.find();//returns 3 items, that's OKtestCol.find({"a":2});//returns 1 item, that's also OKtestCol.ensureIndex({"a":1});testCol.setData([{"a":1,"b":4},{"a":2,"b":5},{"a":3,"b":6}]);testCol.find();//returns 3 items, the last setData replaced old datatestCol.find({"a":2});//returns 2 items, [ {"a":2,"b":2} , {"a":2,"b":5} ] , that's not OK
As a workaround, using truncate before setData works fine.
Probably setData is not updating the indexes.
Edit:
Forgot to say, I'm using Forerunner 2.0.22.
The text was updated successfully, but these errors were encountered:
Hi there,
I've found what I think is a bug. In summary, when using
setData
to set the collection contents and there is an index, lookups using this index can return duplicate data.As a workaround, using
truncate
beforesetData
works fine.Probably
setData
is not updating the indexes.Edit:
Forgot to say, I'm using Forerunner 2.0.22.
The text was updated successfully, but these errors were encountered: