Skip to content

Instantly share code, notes, and snippets.

View itsabdessalam's full-sized avatar
🤔
Thinking

Abdessalam Benharira itsabdessalam

🤔
Thinking
View GitHub Profile
StoreSchema.statics.findByCoordinates = function(coordinates, maxDistance) {
return this.aggregate([
{
$geoNear: {
near: {
type: "Point",
coordinates: coordinates
},
maxDistance: maxDistance,
distanceField: "dist.calculated",
@itsabdessalam
itsabdessalam / Store.js
Last active March 3, 2023 17:02
Store mongoose model
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
// On définit le schéma du Store
const StoreSchema = new Schema({
name: {
type: String,
required: true
},
address: {
@itsabdessalam
itsabdessalam / welcome.png
Last active March 25, 2020 12:16
👋Welcome to my GitHub Profile !
welcome.png