We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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



13.2k
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... =/



13.2k

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