-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Hi!
I'm facing a problem that request are returning empty data.
For example:
my mongodb collection:
{ "_id" : "1", "name" : "Moscow" }, { "_id" : "2", "name" : "London" }
cities resource:
'use strict';
const jsonApi = require('jsonapi-server'),
Joi = jsonApi.Joi;
const MongoHandler = require('jsonapi-store-mongodb');
module.exports = {
resource: 'cities',
handlers: new MongoHandler({
url: "mongodb://localhost:27017/data",
}),
attributes: {
name: Joi.string(),
}
};
After this request:
http://localhost:4000/cities
I am getting this:
{"jsonapi":{"version":"1.0"},"meta":{"page":{"offset":0,"limit":50,"total":2}},"links":{"self":"/cities"},"data":[],"included":[]}
For some reason total==2 but api isn't providing any data.
Maybe something is wrong with the structure of my collection?
Many thanks in advance.
Metadata
Metadata
Assignees
Labels
No labels