loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.25606879999890664","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"Y29uc3QgQXBwYmFzZSA9IHJlcXVpcmUoImFwcGJhc2UtanMiKTsKCi8vIENyZWF0ZSBhcHBiYXNlIGluc3RhbmNlIHRvIHVzZSBtZXRob2RzCmNvbnN0IGFwcGJhc2VSZWYgPSBBcHBiYXNlKHsKICB1cmw6ICJodHRwczovL3NjYWxyLmFwaS5hcHBiYXNlLmlvIiwKICBhcHA6ICJob3VzaW5nLWRlbW8iLAogIGNyZWRlbnRpYWxzOiAiWW5DZ1Z3b3pWOmU5ZWM1Y2IwLTU4ZDgtNGJiMC1iYWRjLWFjYWY3MjY2NjFmMSIKfSk7CgovLyBEYXRlIHF1ZXJ5IHRvIGdldCBob3VzZXMgdGhhdCBhcmUgYXZhaWxhYmxlIGJldHdlZW4gY2VydGFpbiBkYXRlcwphcHBiYXNlUmVmLnNlYXJjaCh7CiAgdHlwZTogImxpc3RpbmciLAogIGJvZHk6IHsKICAgIHF1ZXJ5OiB7CiAgICAgIGJvb2w6IHsKICAgICAgICBtdXN0OiBbCiAgICAgICAgICB7CiAgICAgICAgICAgIHJhbmdlOiB7CiAgICAgICAgICAgICAgZGF0ZV9mcm9tOiB7CiAgICAgICAgICAgICAgICBndDogMjAxNzAxMDEKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgIH0sCiAgICAgICAgICB7CiAgICAgICAgICAgIHJhbmdlOiB7CiAgICAgICAgICAgICAgZGF0ZV90bzogewogICAgICAgICAgICAgICAgbHQ6IDIwMTcwNDMwCiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgXQogICAgICB9CiAgICB9CiAgfQp9KS50aGVuKHJlc3BvbnNlID0+IHsKICAvLyBMb2dnaW5nIGhpdHMgd2hpY2ggY29udGFpbnMgYWxsIHRoZSBkYXRhIG1hdGNoZWQgYnkgcXVlcnkKICBjb25zb2xlLmxvZygiU3VjY2VzczogIiwgSlNPTi5zdHJpbmdpZnkocmVzcG9uc2UuaGl0cywgbnVsbCwgJ1x0JykpOwp9KS5jYXRjaChlcnJvciA9PiB7CiAgY29uc29sZS5sb2coIkVycm9yOiAiLCBlcnJvcik7Cn0pOw=="},"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"
});

// Date query to get houses that are available between certain dates
appbaseRef.search({
  type: "listing",
  body: {
    query: {
      bool: {
        must: [
          {
            range: {
              date_from: {
                gt: 20170101
              }
            }
          },
          {
            range: {
              date_to: {
                lt: 20170430
              }
            }
          }
        ]
      }
    }
  }
}).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