newtomongo
unread,Jan 24, 2012, 11:08:17 AM1/24/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
I am very new to Mongo, but have a system up and running and done some
queries. However, if I do a 'find' when the field contains spaces e.g
[Regular ID] not [Regular_ID], it does not work! (part of a record):
[_id] => MongoId Object (
[$id] => 000000000000000000000000
)
[Regular ID] => 5176
[External ID] => MAL_146
......
.....
$query = array( "Regular ID" => array( '$lt' => "1000" ) );
$cursor = $collection->find( $query );
foreach ($cursor as $obj) {
echo $obj["Regular ID"] . chr(10);
}
?>
I just get nothing although 'Regular IDs' exist below 1000.
If I change the record field to [Regular_ID] it works... I just can't
find any places where it is explained why this should not work ?? Is
there a way to handle spaces in fields so queries will work as
expected ?
If I search directly on the ID (not using $lt / $gt), it also works
Thanks!