简体   繁体   中英

Find data from coordinates in Arrow DB

After reading docs https://docs.appcelerator.com/arrowdb/latest/#!/guide/customfields I coud not find any way to get data from coordinates with arrow DB projet (when you deploy it in the cloud !).

I try this :

req.model.query({
    coordinates: {
        "$nearSphere": [50.8331170,4.3846790], // test values
        "$maxDistance": 0.1
    }
}, next);

My model look like this :

var Arrow = require('arrow');

var Model = Arrow.createModel('test', {
    fields: {
        coordinates: {
            type: Array
        },
        name: {
            type: String
        },
        description: {
            type: String
        }
    },
    connector: 'appc.arrowdb',
    autogen: false
});

module.exports = Model;

To be clear I want to find some data around a "location"
Someone have an idea for that ?

您可以使用 $geonear,它在https://docs.appcelerator.com/arrowdb/latest/#!/guide/search_query 中提到,搜索近球

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM