Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Won't Fix
-
None
-
None
-
None
-
shell
-
Fully Compatible
-
ALL
Description
Simple test:
> a = ObjectId()
|
ObjectId("4d6e43c970953cc4bf43b8cc")
|
> db.test.insert({a:a})
|
> doc = db.test.findOne()
|
{
|
"_id" : ObjectId("4d6e43d170953cc4bf43b8cd"),
|
"a" : ObjectId("4d6e43c970953cc4bf43b8cc")
|
}
|
> doc.a.equals(a)
|
true
|
> doc.a.toString() === a.toString()
|
true
|
> doc.a === a
|
false
|
> doc.a == a
|
false
|
> db.version()
|
1.7.4
|
For example, PHP driver works great with it:
<?php
|
$id = new MongoID(); |
$sameId = new MongoID((string)$id); |
|
var_dump($id == $sameId); // bool(true) |
var_dump($id === $sameId); // bool(false) |
Followed by discussion in groups:
http://groups.google.com/group/mongodb-user/browse_thread/thread/77c0c55e24e97a08
Attachments
Issue Links
- is related to
-
SERVER-2844 Shell inserts integers as doubles
-
- Closed
-
-
SERVER-854 Way to create an integer in javascript
-
- Closed
-
-
SERVER-776 way to create long in js
-
- Closed
-
-
SERVER-3383 NumberInt(1) != NumberInt(1), is that intentional?
-
- Closed
-
- related to
-
SERVER-8246 Min/MaxKey on V8 are not comparable
-
- Closed
-
-
SERVER-1672 (new NumberLong(3754)==new NumberLong(3754)) evals to false
-
- Closed
-