You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would love a feature to do the following: Test an arbitary object to see if it would pass or fail a "find" kind of expression. I'm sure you have it internally, would it be hard to expose to the API ?
var Mingo = require('mingo');
// or just access Mingo global in browser
// setup the key field for your collection
Mingo.setup({
key: '_id' // default
});
// create a query with criteria
// find all grades for homework with score >= 50
var result = Mingo.Test({ type: "homework", score: 55}, { $gte: 50 } });
if (result)
alert("Passed!");
else
alert("Failed!");
Is this possible?
The text was updated successfully, but these errors were encountered:
wolfen351
changed the title
Feature request
Feature request: Test function
Aug 20, 2014
Hi there
I would love a feature to do the following: Test an arbitary object to see if it would pass or fail a "find" kind of expression. I'm sure you have it internally, would it be hard to expose to the API ?
var Mingo = require('mingo');
// or just access Mingo global in browser
// setup the key field for your collection
Mingo.setup({
key: '_id' // default
});
// create a query with criteria
// find all grades for homework with score >= 50
var result = Mingo.Test({ type: "homework", score: 55}, { $gte: 50 } });
if (result)
alert("Passed!");
else
alert("Failed!");
Is this possible?
The text was updated successfully, but these errors were encountered: