runner36 / rock-php

Automatically exported from code.google.com/p/rock-php
0 stars 0 forks source link

Wrong update for field of type ObjectId #206

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Open a field of type ObjectId for update
2.Enter a new value (same syntax)
3.Click "Apply"

What is the expected output? What do you see instead?

The field should be updated whith the new value.
Instead we get a sub-value value not suitable.

Example:

 I wand to change this field:
   "refid": { "value": ObjectId("4fe30f2c03bdeda704000000") }
 with, let say, the value "4fe30f2c03bdeda704000021".
 What I get is:
   "refid": { "value": ObjectId("4fe30f2c03bdeda704000021") }

NB: this kind of update is OK with ISODate fields...

RockMongo Version (1.1.0, ...)
1.1.2 (and previous)

Operation System (Windows/CentOS, ...)
Client Windows, server Ubuntu or CentOS)

PHP Version (5.1.6, ...)
5.3.13

php_mongo Version (1.0.9, ...)
mongo/1.2.10

MongoDB version (1.8.5, ...)
2.0.6

Please provide any additional information below.

Original issue reported on code.google.com by acord...@tftlabs.com on 21 Jun 2012 at 2:55

GoogleCodeExporter commented 8 years ago
I think above "What I get is:" is wrong. What I get is is like:
"_id": {
    "str": "530c68121d636d09fb000034"       
}

instead of "_id": { ObjectId("4fe30f2c03bdeda704000000") }

Original comment by akostadi...@gmail.com on 25 Feb 2014 at 10:04

GoogleCodeExporter commented 8 years ago
The "what I get" was right in my message...
What was wrong was my "I wand to change this field:" sentence.

When I try to individually update a field of type "ObjectId" like this one:

 "user_refid": ObjectId("4f0d6c5990268f937be7610f") 

I get this:

 "user_refid": {
   "value": ObjectId("4f0d6c5990268f937be7610f") 
 }

It works well when updating the whole object, but not when updating a single 
field.

NB: you cannot update an "_id" field this way (contextual menu is not 
available)...

Original comment by acord...@tftlabs.com on 25 Feb 2014 at 10:22

GoogleCodeExporter commented 8 years ago
then your issue is not same as mine. I see a contextual menu for my filed but 
ObjectId() gets mangled. I think your issue has more chances to catch attention 
in github where project moved btw.

Original comment by akostadi...@gmail.com on 25 Feb 2014 at 10:44