-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
findOne return is not array #79
Comments
I found the solution. use the "typeMap" option.
|
the method "find" return is object. and "typeMap" option does not work. |
findOne has always returned an Object while find returns an array. I believe it has always been like this. Otherwise use find with limit 1 to get an array |
As of 1.0.0-beta2, Furthermore, the Client, Database, and Collection objects can also be constructed with a As noted in the 1.0.0-beta2 release notes, we intend to have a more user-friendly default type map, so documents and arrays may be returned as ArrayObjects instead of stdClass and array, respectively. This will allow us to ensure we preserve their BSON types when going back to the database (i.e. object data can be cast back to stdClass and arrays can be filtered through |
#78 is merged, so we're now returning ArrayObject instances for BSON document and array types, each of which handle BSON serialization for documents and arrays on the way back into the database. With this change, you can use array access on both types (e.g. Expect a 1.0.0 release with these new defaults soon. |
output is object.
The text was updated successfully, but these errors were encountered: