Skip to content

EJSON parameter support #7

@radiegtya

Description

@radiegtya

Using Meteor.call and Meteor.subscribe parameter is very important for production apps.
For now the parameter still only able to pass strings of object. We can't pass value like integer, Date etc. Maybe we need to make EJSON support.

If I am not wrong we can use this npm package https://www.npmjs.com/package/ejson.

For example:

var filters = {
   createdAt: {$gt: new Date()},
   vote: 5
};
filters = EJSON.stringify(filters); //stringify the object first
filters = EJSON.parse(filters); //make to EJSON obj
Meteor.subscribe('some_collections', [filters], function(someCollections){
   console.log(someCollections);
});

I think the above code should be simplified in "react-native-meteor" module instead manually doing that.
Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions