无论如何,我可以根据来自mongodb的数组集进行一些计算

问题描述 投票:0回答:1

我如何处理来自我的数据库的数据,其中包含以json格式存储的随机用户坐标及其个人资料。我的问题是我已经拥有了数据库中的所有数据以及客户端浏览器的坐标,我如何才能找到当前客户端与数据库中的数据之间的距离,以便最终获得两个地理位置并最终将其循环以显示在浏览器中]

 address: "text"
    category: "Dealers"
    cord_lat: 7.616398500000001
    cord_long: 4.1372235
    email: "[email protected]"
    imageUrl: "http://localhost:3000/uploads/1576507509331-tohshine.jpg"
    location: "text"
    name: "tohshine dealer and motors"
    services: "text"
    siteUrl: "hq.co.uk"
    tel: "2344-444-55"
    user: "5ded6cb6993cdc3e3c8735f9"
    __v: 0
    _id: "5df794581efb724528f45a80"
    __proto__: Object
    length: 1
    __proto__: Array(0)
node.js reactjs
1个回答
0
投票

这是一个项目,不是问题。请花点时间开始研究,然后张贴您卡在其中的哪一部分

© www.soinside.com 2019 - 2024. All rights reserved.