This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local MongoClient = require("luaMongo.MongoClient") | |
local client = MongoClient.new("mongodb://localhost:27017/") | |
local exampleDatabase = client:getDatabase("exampleDB") | |
local exampleCollection = exampleDatabase:getCollection("exampleCollection") | |
-- Create document to insert. | |
local document_to_insert = {foo = "bar"} | |
-- Insert document into database | |
exampleCollection:insert_one(document_to_insert) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.data.find({"st" : "u103840", | |
"ts" : {"$gte": ISODate("1989-01-01"), | |
"$lt" : ISODate("1990-01-01")}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"st" : "u725053", | |
"ts" : ISODate("2013-06-03T22:51:00Z"), | |
"position" : { | |
"type" : "Point", | |
"coordinates" : [ | |
-96.4, | |
39.117 | |
] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.data.find({"st" : "u747940", | |
"ts" : ISODate("1969-07-16T12:00:00Z")}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.data.find({"ts" : ISODate("2000-01-01T00:00:00Z")}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.data.find ({ | |
"presentWeatherObservation.condition" : "99" | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.data.aggregate ([ | |
{ "$match" : { "airTemperature.quality" : | |
{ "$in" : [ "1", "5" ] } } }, | |
{ "$group" : { "_id" : null, | |
"maxTemp" : { "$max" : | |
"$airTemperature.value" } } } | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "_id" : ObjectId("5063114bd386d8fadbd6b004"), | |
"name" : "Brian D. Goodman", | |
"organizations" : ["MongoDB”], | |
"locations" : [ | |
{ "type" : "work", | |
"address" : "229 W 34 St., 5th floor", | |
"city" : "New York", | |
"state" : "NY", | |
"zipcode" : "10036" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "_id" : ObjectId("5063114bd386d8fadbd6b004"), | |
"name" : "Brian D. Goodman", | |
"organizations" : ["MongoDB”], | |
"locations" : [ | |
{ "type" : "work", | |
"address" : "229 W 34 St., 5th floor", | |
"city" : "New York", | |
"state" : "NY", | |
"zipcode" : "10036" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"_id" : ObjectId("5063114bd386d8fadbd6b004"), | |
"name" : "Brian D. Goodman", | |
"organizations" : ["MongoDB"], | |
"locations" : [ | |
{ "type" : "work", | |
"address" : "229 W 34 St., 5th floor", | |
"city" : "New York", | |
"state" : "NY", | |
"zipcode" : "10036" | |
} |
OlderNewer