-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamples.js
More file actions
executable file
·48 lines (44 loc) · 1.04 KB
/
examples.js
File metadata and controls
executable file
·48 lines (44 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Insert
SuggestionStore.getStorage("ft", 2, function(e, o) {
o.insertDocument({
"id": 123,
"type": "A",
"text": "A andorinha voou."
}, function() {
o.insertDocument({
"id": 124,
"type": "A",
"text": "Uma andorinha voou."
}, function() {
console.log("inserido");
});
});
});
// Update
SuggestionStore.getStorage("ft", 2, function(e, o) {
o.updateDocument({
"id": 124,
"type": "A",
"text": "As andorinhas voaram."
}, function() {
console.log("atualizado");
});
});
// Search
SuggestionStore.getStorage("ft", 2, function(e, o) {
o.search("a and", function(err, res) {
console.log(res);
});
});
SuggestionStore.getStorage("ft", 2, function(e, o) {
o.updateDocument({
"id": 123,
"type": "A",
"text": "Duas andorinha voaram."
}, function() {
});
});
// Delete
SuggestionStore.getStorage("ft", 2, function(e, o) {
o.deleteDocument("A:123", function() {});
});