D
D
driver4582017-07-23 06:14:35
MongoDB
driver458, 2017-07-23 06:14:35

How to make a selection in MongoDB?

I have a base with mobile phones. Let's say I want to make a selection on the operating system "iOS".
Intuitively tried to write something, but did not work out.

param: [{
            "@name": "Операционная система",
            "#text": "iOS"
        }]

How to implement it with such base? Screen is attached. It will be cool if immediately with the expectation of Mongoose.
I also don't understand what @ and # mean here.
eac600343cf54f329197f455f3b38c71.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
driver458, 2017-07-23
@driver458

Got it , https://docs.mongodb.com/manual/reference/operator...

{
        param: {
            $all: [
                { "$elemMatch": { "@name": "Операционная система", "#text": "iOS" } }
            ]
        }
}

https://msdn.microsoft.com/en-us/library/ms175874(...
Certain characters at the beginning of an identifier in SQL Server have a special meaning. A regular identifier that begins with @ signifies a local variable or parameter and cannot be used as the name of an object of any other type. An identifier that begins with a pound sign (#) indicates a temporary table or procedure. An identifier that starts with a double pound sign (##) means a global temporary object. Although the hash and double hash characters can be used at the beginning of other types of object names, we do not recommend this way of naming.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question