Automattic / Automattic/monk

_id from findOne is not ObjectID

Open
#268 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.8k
Forks
180
PR merge metrics
No merged PRs in 30d

Description

```js
it.only("", async () => {
await db.get("ttt").insert({ name: "bbb", otherId: new ObjectID() })
let a = await db.get("ttt").findOne({ name: "bbb" })
try {
expect(a._id instanceof ObjectID).true
expect(a.OtherId instanceof ObjectID).true
} catch (e) {
console.log(e)
}
})
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the JavaScript reproduction in issue #268 and trace the insert and findOne entry points to inspect the returned _id and otherId values. Verify the field names used by the assertion, then confirm that both returned identifiers are ObjectID instances.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.