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

Error message using $set #121

Closed
yunosh opened this issue Jun 30, 2016 · 2 comments
Closed

Error message using $set #121

yunosh opened this issue Jun 30, 2016 · 2 comments
Labels
Milestone

Comments

@yunosh
Copy link

yunosh commented Jun 30, 2016

The following code snippet works fine with using ext/mongo directly:

            $res = $this->_db->findAndModify(
                array(
                    self::SID => $id,
                    self::LOCK => array('$exists' => $exist_check)
                ),
                array($data),
                array(self::DATA => true),
                array(
                    'update' => array('$set' => $data),
                    'upsert' => !$exists
                )
            );

but throws the following error when using mongo-php-adapter:

MongoResultException: exception: The dollar ($) prefixed field '$set' in '$set' is not valid for storage.

@alcaeus
Copy link
Owner

alcaeus commented Jul 3, 2016

Fixing this in #122.

Out of curiosity: why are you passing both an update parameter and the update option? Normally you'd only specify one. This confused me for a moment, especially since what you're passing in the update parameter is different from what the update option would apply.

@alcaeus alcaeus closed this as completed Jul 3, 2016
@yunosh
Copy link
Author

yunosh commented Jul 4, 2016

No idea, that was code contributed by someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants