Why it was necessary to use MongoDB query syntax with "array()" in PHP driver extension for MongoDB?
-
In at least Ruby and Python implementation of MongoDB driver you use nearly identical syntax for commands that are used in Mongo shell which are compact and natural. Why in PHP driver everything is polluted with array() ?
-
Answer:
A object in javascript is effectively a hashtable. PHP does not support a true hashtable or dictionary. Instead, PHP arrays actually serve as ordered dictionaries with some really funky behaviour from the various sort methods. So basically, the PHP equivalent of a JSON object is really a bunch of arrays using the "dictionary" syntax. And that's the answer to your question. The closest thing PHP has to JSON is the crazy array syntax.
Gaëtan Voyer-Perrault at Quora Visit the source
Related Q & A:
- How to use hierarchical query in Infinispan?Best solution by mastertheboss.com
- How can we use MongoDb with postgresql?Best solution by Stack Overflow
- Why is it necessary for a marketing person to understand accounting and financial information?Best solution by Yahoo! Answers
- What is Vitamin B and why is it necessary?Best solution by Yahoo! Answers
- Why exam is necessary?Best solution by debate.org
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.