PHP operating MongoDB module linux, detailed screenshots (7), mongodblinux

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.