forked from hungvietdo/MSCHackathon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblogspot.js
More file actions
23 lines (18 loc) · 685 Bytes
/
blogspot.js
File metadata and controls
23 lines (18 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var MongoClient = require('mongodb').MongoClient;
var uri = "mongodb+srv://admin:admin@cluster0-zoamm.mongodb.net/blogspot";
MongoClient.connect(uri, function(err, client) {
const collection = client.db("blogspot").collection("comments");
var query = { "$text": {"$search": "\"00130857877628131980\"" }};
// collection.findOne(query, function(err, result) {
// if (err) throw err;
// console.log(result.author.displayName);
// console.log(result.content);
// console.log(result.published);
// });
collection.find(query).toArray(function(err, result) {
if (err) throw err;
console.log(result);
//db.close();
});
client.close();
});