PHP Driver for mongodb - returns error: Fatal error: Uncaught exception 'MongoException' with message ''.' not allowed in key: test.server.1

11 views
Skip to first unread message

markpat...@gmail.com

unread,
May 12, 2016, 3:28:59 PM5/12/16
to mongodb-user
Hi there. 

I am have a mongodb server (version 3.0.4) running with PHP 5.6.11 and 1.6.13 of the mongo driver. 
I've run into a problem where I'm trying to insert an array into a collection, but the system is returning the above error message to me. 

I'm trying to build a prototype for our company to showcase the ease of use of mongo / no sql databases... 
If anyone can help me out, I'd really appreciate it. 

Ps. I thought it'd be easier to leave the original question in stackoverflow so that I don't have to update both posts / communities but if you prefer I post the full question here, I'm happy to do so. 

Thanks in advance for your time and consideration. 


Tim Hawkins

unread,
May 12, 2016, 8:41:56 PM5/12/16
to mongodb-user

Check for any fields with a '.' Character in the name.  This is a difference between 2.6 and 3.0,  the older versions used to allow it, but silently fail on any queries on that field.

That is what the error message is trying to tell you.

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/adcc3569-afe2-4b1b-8b2c-542da5de4a54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim Hawkins

unread,
May 12, 2016, 8:43:47 PM5/12/16
to mongodb-user

test.server.1' => array (size=1)

There is your problem, dots are not allowed in keys

Reply all
Reply to author
Forward
0 new messages