How to use the address.geo function in address

To help you get started, we’ve selected a few address examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphql-compose / graphql-compose-examples / examples / user / models / user.js View on Github external
query: (rawQuery, value) => {
      if (!value.lng || !value.lat || !value.distance) return;
      // read more https://docs.mongodb.com/manual/tutorial/query-a-2dsphere-index/
      rawQuery['address.geo'] = {
        $near: {
          $geometry: {
            type: 'Point',
            coordinates: [value.lng, value.lat],
          },
          $maxDistance: value.distance, // 
        },
      };
    },
  })
github rabbotio / nap / graphql / user / models / user.js View on Github external
query: function query(rawQuery, value, resolveParams) {
    if (!value.lng || !value.lat || !value.distance) return;

    rawQuery['address.geo'] = {
      $near: {
        $geometry: {
          type: 'Point',
          coordinates: [value.lng, value.lat] },

        $maxDistance: value.distance } };


  } }));