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

MongoDB - array serialisation of nested keys #20

Merged
merged 3 commits into from
Oct 28, 2016

Conversation

dimasikturbo
Copy link
Contributor

Arrays have to be serialized as well

After using mongo backend as a storage i came across an issue with arrays as data. When a key in associative array has dots, mongo throws exception:

MongoCursorException: localhost:27017: The dotted field 'A.B' in 'data.A.B' is not valid for storage.

Proposed fix

If input data is array it is serialized same way as in case of an object.

I also changed how serialized data is stored - there is a new property "serialized" which holds binary data. When data is fetched from the mongo we either de-serialize it, or use raw "data"

@coveralls
Copy link

coveralls commented Oct 27, 2016

Coverage Status

Coverage increased (+0.003%) to 99.428% when pulling f29807b on dimasikturbo:mongodb into dcbd00a on frqnck:mongodb.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 99.428% when pulling f29807b on dimasikturbo:mongodb into dcbd00a on frqnck:mongodb.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 99.428% when pulling f29807b on dimasikturbo:mongodb into dcbd00a on frqnck:mongodb.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 99.428% when pulling f29807b on dimasikturbo:mongodb into dcbd00a on frqnck:mongodb.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 99.428% when pulling f29807b on dimasikturbo:mongodb into dcbd00a on frqnck:mongodb.

@frqnck frqnck changed the title Mongodb Mongodb - array serialisation of nested keys Oct 28, 2016
@frqnck frqnck changed the title Mongodb - array serialisation of nested keys MongoDB - array serialisation of nested keys Oct 28, 2016
@frqnck frqnck merged commit 44d903d into apix:mongodb Oct 28, 2016
@frqnck frqnck self-assigned this Oct 28, 2016
frqnck added a commit that referenced this pull request Oct 28, 2016
* mongodb: (25 commits)
  Prepping release 1.2.8
  MongoDB - array serialisation of nested keys (#20)
  Allow HHVM and `mongodb` ext to fail under Travis
  Installing HHVM so we can compile mongo-hhvm-driver
  i
  i
  Added "sudo: required" as per http://stackoverflow.com/questions/26299552/travis-sudo-is-disabled
  [skip ci]
  Update README.md
  Test for hphpize
  test fix mongo-hhvm-driver
  Fix for HHVM
  Install for mongo-hhvm-driver
  Fix PHP 5.3 by using `arrav()` instead of  `[]`.
  Test for an InvalidArgumentException
  Refactored
  Adds support got HHVM
  Adds MongoDB library
  More explicit skip message [skip ci]
  minor [skip ci]
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants