I'm trying to get a Mongoose scheme to perform point based $near finds. I'm just trying to obtain random documents and I'm getting guide from this answer.
I've tried:
    Video.where('randomTag').near({
        center: {
            type: 'Point',
            coordinates: [-98.18, 19]
        }
    }).exec(function (err, videos) {
        console.log(err)
        response.json(videos);
    })
Also:
    Video.near('randomTag',{
        center: {
            type: 'Point',
            coordinates: [-98.18, 19]
        }
    }).exec(function (err, videos) {
        console.log(err)
        response.json(videos);
    })
And:
    Video.find({
        randomTag: {
            $near: {
                $geometry: {
                    type: "Point",
                    coordinates: [Math.random()/Math.random(), 0]
                }
            }
        }
    }).exec(function (err,videos) {
        response.json(videos)
    })
And for all those attemps I got this error:
error: Can't use $near with Number.
I already got the required index:
{randomTag: '2dsphere'} 
The schema looks like:
{
  videoId: String,
  randomTab: Array(Number),
  title: String,
  playCount: Number
}
Here is some sample data.
{
    "videoId": "aRDAz55d-y",
    "randomTag": [2.255285185646381,0],
    "title": "La décima, inolvidable",
    "playCount": 254111
}
{
    "videoId": "vAFj32af",
    "randomTag": [0.4515513067517708,0],
    "title": "SILePetitPrince",
    "playCount": 900
}
This is whole error trace:
Error: Can't use $near with Number.
    at SchemaNumber.castForQuery (/storage/home/dev/final-cut/node_modules/mongoose/lib/schema/number.js:261:13)
    at module.exports (/storage/home/dev/final-cut/node_modules/mongoose/lib/cast.js:196:39)
    at Query.cast (/storage/home/dev/final-cut/node_modules/mongoose/lib/query.js:2341:10)
    at Query.find (/storage/home/dev/final-cut/node_modules/mongoose/lib/query.js:998:10)
    at Function.find (/storage/home/dev/final-cut/node_modules/mongoose/lib/model.js:1026:13)
    at sayHello (/storage/home/dev/final-cut/api/controllers/api.js:23:15)
    at Layer.handle [as handle_request] (/storage/home/dev/final-cut/node_modules/express/lib/router/layer.js:95:5)
    at next (/storage/home/dev/final-cut/node_modules/express/lib/router/route.js:131:13)
    at Route.dispatch (/storage/home/dev/final-cut/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/storage/home/dev/final-cut/node_modules/express/lib/router/layer.js:95:5)
    at /storage/home/dev/final-cut/node_modules/express/lib/router/index.js:277:22
    at Function.process_params (/storage/home/dev/final-cut/node_modules/express/lib/router/index.js:330:12)
    at next (/storage/home/dev/final-cut/node_modules/express/lib/router/index.js:271:10)
    at Function.handle (/storage/home/dev/final-cut/node_modules/express/lib/router/index.js:176:3)
    at router (/storage/home/dev/final-cut/node_modules/express/lib/router/index.js:46:12)
    at Layer.handle [as handle_request] (/storage/home/dev/final-cut/node_modules/express/lib/router/layer.js:95:5)
GET /api/hello 500 20.560 ms - -
The reason of the Math.random() use is because of the randomness need. Is there something I'm missing?
 
     
    