kevin-xw / rock-php

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

Handling a primary composite key #231

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
>What steps will reproduce the problem?
1. Create a composite primary key, inserting an array in an _id field.
2. Insert data. The _id field must be an array with an unique composite value.
3. Try to delete or update the document with RockMongo.

>What is the expected output? What do you see instead?
It is not possible to update or to delete a document if the primary key is a 
composite key. Sometimes I got the following error:

Notice: Undefined index: _id in \themes\default\views\collection\modifyRow.php 
on line 18

>RockMongo Version (1.1.0, ...)
1.1.2

>Operation System (Windows/CentOS, ...)
Windows 7

>PHP Version (5.1.6, ...)
5.3.8

>php_mongo Version (1.0.9, ...)
1.1.4

>MongoDB version (1.8.5, ...)
2.0.2

>Please provide any additional information below.
I think RockMongo is not prepared to support composite primary keys. In my 
case, I am using a key like this in some of my collections:

"_id": {
    "USER_ID": ObjectId("509676d8d2ecc8ed36000002"),
    "TARGET_ID": ObjectId("508eb82ad2ecc8c42b000000") 
}

Original issue reported on code.google.com by puls...@gmail.com on 5 Nov 2012 at 1:27

GoogleCodeExporter commented 9 years ago
Fixed in git repository, you can download latest build from 
    https://github.com/iwind/rockmongo/archive/master.zip 
or clone source from

Original comment by iwind....@gmail.com on 25 Nov 2012 at 3:12

GoogleCodeExporter commented 9 years ago
or clone source from https://github.com/iwind/rockmongo.git

Original comment by iwind....@gmail.com on 25 Nov 2012 at 3:18