loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.053733907240664625","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"Y29uc3QgQXBwYmFzZSA9IHJlcXVpcmUoImFwcGJhc2UtanMiKTsKCi8vIENyZWF0ZSBhcHBiYXNlIGluc3RhbmNlIHRvIHVzZSBtZXRob2RzCmNvbnN0IGFwcGJhc2VSZWYgPSBBcHBiYXNlKHsKICB1cmw6ICJodHRwczovL3NjYWxyLmFwaS5hcHBiYXNlLmlvIiwKICBhcHA6ICJob3VzaW5nLWRlbW8iLAogIGNyZWRlbnRpYWxzOiAiWW5DZ1Z3b3pWOmU5ZWM1Y2IwLTU4ZDgtNGJiMC1iYWRjLWFjYWY3MjY2NjFmMSIKfSk7CgovLyBRdWVyeSBieSBjb21iaW5pbmcgbXVsdGlwbGUgY29uZGl0aW9ucwovLyBRdWVyeWluZyBgcm9vbV90eXBlYGFzICJwcml2YXRlIiBhbmQgYHByaWNlYCBiZXR3ZWVuIDk1IGFuZCAxMDAKYXBwYmFzZVJlZi5zZWFyY2goewogIHR5cGU6ICJsaXN0aW5nIiwKICBib2R5OiB7CiAgICBxdWVyeTogewogICAgICBib29sOiB7CiAgICAgICAgbXVzdDogWwogICAgICAgICAgewogICAgICAgICAgICBtYXRjaDogewogICAgICAgICAgICAgIHJvb21fdHlwZTogInByaXZhdGUiCiAgICAgICAgICAgIH0KICAgICAgICAgIH0sCiAgICAgICAgICB7CiAgICAgICAgICAgIHJhbmdlOiB7CiAgICAgICAgICAgICAgcHJpY2U6IHsKICAgICAgICAgICAgICAgIGd0ZTogOTUsCiAgICAgICAgICAgICAgICBsdGU6IDEwMAogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgIF0KICAgICAgfQogICAgfQogIH0KfSkudGhlbihyZXNwb25zZSA9PiB7CiAgLy8gTG9nZ2luZyBoaXRzIHdoaWNoIGNvbnRhaW5zIGFsbCB0aGUgZGF0YSBtYXRjaGVkIGJ5IHF1ZXJ5CiAgY29uc29sZS5sb2coIlN1Y2Nlc3M6ICAiLCBKU09OLnN0cmluZ2lmeShyZXNwb25zZS5oaXRzLCBudWxsLCAnXHQnKSk7Cn0pLmNhdGNoKGVycm9yID0+IHsKICBjb25zb2xlLmxvZygiRXJyb3I6ICIsIGVycm9yKTsKfSk7"},"asBuffer":null},"loaded":true}}
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
const Appbase = require("appbase-js");

// Create appbase instance to use methods
const appbaseRef = Appbase({
  url: "https://scalr.api.appbase.io",
  app: "housing-demo",
  credentials: "YnCgVwozV:e9ec5cb0-58d8-4bb0-badc-acaf726661f1"
});

// Query by combining multiple conditions
// Querying `room_type`as "private" and `price` between 95 and 100
appbaseRef.search({
  type: "listing",
  body: {
    query: {
      bool: {
        must: [
          {
            match: {
              room_type: "private"
            }
          },
          {
            range: {
              price: {
                gte: 95,
                lte: 100
              }
            }
          }
        ]
      }
    }
  }
}).then(response => {
  // Logging hits which contains all the data matched by query
  console.log("Success:  ", JSON.stringify(response.hits, null, '\t'));
}).catch(error => {
  console.log("Error: ", error);
});
node v10.16.0