Coder Social home page Coder Social logo

sky_test's Introduction

技术栈

  • server: koa2 + graphql + koa-graphql + mongoose

数据库部分

通过graphiql演示需要做数据持久化,使用的 mongodb 数据库。

地理位置信息,距离比较通过使用mongodb内置的GeoJson相关API实现。

进入当前的工程目录,运行mongo镜像,相关mock数据直接使用data中的数据。

cd sky_test
docker pull mongo
docker run -p 27017:27017 - v $PWD/data:/data/db mongo

后端部分

npm run start

访问 http://localhost:4000/graphql 看到数据库操作playground界面。可进行相关的query操作

Query & Mutation

getStoreList

{
  getStoreList(input: [101.15, 39.22, 10000]) {
    id,
    name,
    description,
    geo {type, coordinates},
    favoredUsers{user}
  }
}

getPinList

{
  getPinList(input: [74.25, 40.40, 10000]) {
    id,
    name,
    description,
    geo {type, coordinates}
  }
}

FavorStore

mutation {
  favorStore(store_id: "63db4c7858c939c210bb1f9b",user_id:"63db47cdf9274abb5edad92f") {
    store
    user
  }
}

sky_test's People

Contributors

wehtta avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.