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
the following code should fail on the 2nd time doAssert ai is reached because insert fails (we're inserting with same _id):
import std/[
oids,
asyncdispatch,
]
import nimongo/bson
import nimongo/mongo
proctest_sync2=var m =newMongo()
doAssert m.connect()
let mc = m["tmp"]["tnimongo"]
for i in0..<2:
let doc =%*{
"name": "bob2",
"_id": 123,
}
let ai = mc.insert(doc)
echo ai
doAssert ai
test_sync2()
here's the equivalent D code, which correctly throws:
the following code should fail on the 2nd time
doAssert ai
is reached because insert fails (we're inserting with same_id
):here's the equivalent D code, which correctly throws:
likewise with python, which also throws
note
echo ai
prints this:the
ok: true
should beok: false
, and it should failThe text was updated successfully, but these errors were encountered: