id
algebra.id(props)
Returns the configured id
property value from props
. If there are
multiple ids, a JSON.stringify
-ed JSON object is returned with each
id value is returned.
var algebra1 = new set.Algebra(set.props.id("_id"));
algebra1.id({_id: 5}) //-> 5
var algebra2 = new set.Algebra(
set.props.id("studentId"),
set.props.id("classId")
);
algebra2.id({studentId: 6, classId: "7", foo: "bar"})
//-> '{"studentId": 6, "classId": "7"}'
Parameters
- obj
{Object}
:An instance's raw data.