PHP operating MongoDB module linux, detailed introduction (7), mongodblinux
In linux, why did I quit immediately after I got connected to mongodb?
Connect failed, not connected at all, not just connected and exited.
Check whether mongod is running normally. Check log, process, and port.
How can I write multiple condition query codes such as "or" when I perform php operations on mongoDB database queries?
As far as I know, there is no "or" for mongoDB at present.
But I checked it online just now.
I found the following information. Please refer to it.
The $ or operator is available in mongodb. The example on the official website is as follows:
Simple:
Db. foo. find ({$ or: [{a: 1}, {B: 2}]})
With another field
Db. foo. find ({name: "bob", $ or: [{a: 1 },{ B: 2}]})
The $ or operator retrieves matches for each or clause individually and eliminates duplicates when returning results. A number of $ or optimizations are planned for 1.8. See this thread for details.
$ Or cannot be nested.