adonis-lucid-mongodb
Advanced tools
Comparing version 1.0.29 to 1.0.30
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "1.0.29", | ||
"version": "1.0.30", | ||
"scripts": { | ||
@@ -11,0 +11,0 @@ "lint": "standard", |
@@ -8,3 +8,3 @@ # AdonisJS Lucid MongoDB | ||
[![Build Status](https://travis-ci.org/duyluonglc/adonis-lucid-mongodb.svg?branch=develop)](https://travis-ci.org/duyluonglc/adonis-lucid-mongodb) | ||
[![Coverage Status](https://img.shields.io/coveralls/duyluonglc/adonis-lucid-mongodb/master.svg?style=flat-square)](https://coveralls.io/github/duyluonglc/adonis-lucid-mongodb?branch=master) | ||
[![Coverage Status](https://img.shields.io/coveralls/duyluonglc/adonis-lucid-mongodb/develop.svg?style=flat-square)](https://coveralls.io/github/duyluonglc/adonis-lucid-mongodb?branch=develop) | ||
[![Downloads](https://img.shields.io/npm/dt/adonis-lucid-mongodb.svg?style=flat-square)](https://www.npmjs.com/package/adonis-lucid-mongodb) | ||
@@ -42,3 +42,4 @@ > :pray: This repository is base on adonis-lucid. This package only work with mongodb. | ||
// to query geo near you need declare field type as geometry and add 2d or 2dsphere index in migration file | ||
const images = yield Image.({location: {near: {lat: 1, lng: 1}, maxDistance: 5}}).fetch() | ||
const images = yield Image.({location: {near: {lat: 1, lng: 1}, maxDistance: 5000}}).fetch() | ||
const images = yield Image.({location: {nearSphere: {lat: 1, lng: 1}, maxDistance: 500}}).fetch() | ||
``` | ||
@@ -148,4 +149,2 @@ [More Documentation of mquery](https://github.com/aheckmann/mquery) | ||
user | ||
this.create('articles', (collection) => { | ||
@@ -152,0 +151,0 @@ collection.index('title_index', {title: 1}) |
@@ -732,6 +732,2 @@ 'use strict' | ||
_.forEach(conditions, (c, k) => { | ||
if (!_.isFunction(target.modelQueryBuilder[k])) { | ||
throw new CE.InvalidArgumentException(`Method "$${k}" is not support by query builder`) | ||
} | ||
if (k === 'near' || k === 'nearSphere') { | ||
@@ -748,2 +744,4 @@ let point = {center: [c.lng, c.lat]} | ||
target.modelQueryBuilder.where(key)[k](c) | ||
} else { | ||
throw new CE.InvalidArgumentException(`Method "$${k}" is not support by query builder`) | ||
} | ||
@@ -750,0 +748,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
235699
8342
282