You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| less than | {key:{$lt:value}} | db.customers.find({"age":{$lt:20}}).pretty() |
279
+
| less than equals | {key:{$lte:value}} | db.customers.find({"age":{$lte:20}}).pretty() |
280
+
| greater than | {key:{$gt:value}} | db.customers.find({"age":{$gt:20}}).pretty() |
281
+
| greater than equals | {key:{$gte:value}} | db.customers.find({"age":{$gte:20}}).pretty() |
282
+
| not equals | {key:{$ne:value}} | db.customers.find({"age":{$ne:20}}).pretty() |
283
+
284
+
285
+
# JSON reminder
286
+
JavaScript Object Notation (JSON) is a text format for the serialization of structured data.
287
+
288
+
It is derived from the object literals of JavaScript.
289
+
290
+
JSON can represent four primitive types (strings, numbers, booleans, and null) and two structured types (objects and arrays)
291
+
292
+
#### Primitive JSON
293
+
294
+
Here are four small JSON texts containing only values:
295
+
296
+
```
297
+
"Hello world!"
298
+
42
299
+
true
300
+
null
301
+
```
302
+
303
+
#### Object JSON
304
+
305
+
An object structure is represented as a pair of curly brackets surrounding zero or more **name-value** pairs (or members).
306
+
307
+
An object is an unordered collection of zero or more **name:value** pairs
308
+
309
+
A **name** is a string
310
+
311
+
A **value** is a string, number, boolean, null, object, or array.
312
+
313
+
Declare properties using **name:value** pairings separated by commas
314
+
315
+
Enclose names in curly braces
316
+
317
+
There is no trailing comma
318
+
319
+
This is a JSON object:
320
+
321
+
```
322
+
{
323
+
"Image": {
324
+
"Width": 800,
325
+
"Height": 600,
326
+
"Title": "View from 15th Floor",
327
+
"Thumbnail": {
328
+
"Url": "http://www.example.com/image/481989943",
329
+
"Height": 125,
330
+
"Width": 100
331
+
},
332
+
"Animated" : false,
333
+
"IDs": [116, 943, 234, 38793]
334
+
}
335
+
}
336
+
```
337
+
338
+
#### Array JSON
339
+
340
+
An array structure is represented as square brackets surrounding zero or more values (or elements).
341
+
342
+
Elements are separated by commas.
343
+
344
+
A value must be an
345
+
346
+
```
347
+
object
348
+
array
349
+
number
350
+
string
351
+
three literal names
352
+
true
353
+
false
354
+
null
355
+
```
356
+
357
+
This is a JSON array containing two objects:
358
+
359
+
[
360
+
{
361
+
"precision": "zip",
362
+
"Latitude": 37.7668,
363
+
"Longitude": -122.3959,
364
+
"Address": "",
365
+
"City": "SAN FRANCISCO",
366
+
"State": "CA",
367
+
"Zip": "94107",
368
+
"Country": "US"
369
+
},
370
+
{
371
+
"precision": "zip",
372
+
"Latitude": 37.371991,
373
+
"Longitude": -122.026020,
374
+
"Address": "",
375
+
"City": "SUNNYVALE",
376
+
"State": "CA",
377
+
"Zip": "94085",
378
+
"Country": "US"
379
+
}
380
+
]
381
+
382
+
#### Number
383
+
384
+
The representation of numbers is similar to that used in most programming languages. A number is represented in base 10 using decimal digits. It contains an integer component that may be prefixed with an optional minus sign, which may be followed by a fraction part and/or an exponent part. Leading zeros are not allowed. A fraction part is a decimal point followed by one or more digits.
385
+
386
+
#### String
387
+
388
+
The representation of strings is similar to conventions used in the C family of programming languages. A string begins and ends with **double quotation marks**.
389
+
390
+
source: The Internet Engineering Task Force (IETF)
0 commit comments