Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Storing nested objects in mongodb

Hello,

Greetings,

I am trying nested object something like,

 { 'id' : '1234', 'loc' : { 'lat' : 1234, 'long' : 1234 } }

As,

  $loc = ['long' => $obj->longitude,'lat' => $obj->latitude];
  $obj->loc = $loc;

but, I have got the below exception, [Sun Jun 05 19:37:02 2016] [error] [client 162.243.144.247] exception 'MongoWriteConcernException' with message 'localhost:27017: location object expected, location array not in correct format'.

Please let me know how to do nested objects in mongodb + phalcon save/update.

Raja K



3.5k
edited Jun '16

Seems not working. It says invalid method "assign" , also tried created a separate object.but not working.

Gonna delete my answer then, hopefully it'll re-mark the thread as open

Nope, it's stilled marked as solved... =/



3.5k

I did not understand.

You've marked my reply as a proper answer, so the forum no longer shows your post as unsolved.

I doubt more people will answer, because they see it as solved.

You should either re-ask the question in a new thread, or mark this thread as unsolved somehow