Skip to content
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

Compatibility with doctrine odm #23

Closed
bazo opened this issue Jan 9, 2016 · 1 comment · Fixed by #24
Closed

Compatibility with doctrine odm #23

bazo opened this issue Jan 9, 2016 · 1 comment · Fixed by #24
Assignees
Labels

Comments

@bazo
Copy link

bazo commented Jan 9, 2016

Hi,

when used with doctrine odm the function MongoCollection::batchInsert, more precisely the call to $this->collection->insertMany() raises an error because a stdClass is passed instead of arrays

this is a very quick fix done on directly on my server

    $data = (array)array_values((array)TypeConverter::fromLegacy($a))[0];
    $data = [$data];

     $result = $this->collection->insertMany(
        $data,
            //(array) TypeConverter::fromLegacy($a),
            $this->convertWriteConcernOptions($options)
     );

maybe this will help someone

@alcaeus
Copy link
Owner

alcaeus commented Jan 9, 2016

Thanks for the report, I didn't see ODM actually passes an array with non-numeric keys.

@alcaeus alcaeus added the bug label Jan 9, 2016
@alcaeus alcaeus self-assigned this Jan 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants