Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and improve TypeScript declaration #369

Merged
merged 2 commits into from
Nov 8, 2013
Merged

Fix and improve TypeScript declaration #369

merged 2 commits into from
Nov 8, 2013

Conversation

nerdzeu
Copy link
Contributor

@nerdzeu nerdzeu commented Nov 2, 2013

Now we can use helper functions like orm.ge, orm.like, ecc in Find and sqlquery is a vaild typescript module delclaration.

Commit 2:
Now it's possible to do thing like

req.models["users"].find({ "counter": orm.lte(25) }).each((user) => {
console.log(user["counter"]);
});
req.models["users"].find({ "counter": orm.between(1, 205)
}).each().filter((user) => {
return (user["counter"] % 2) === 0;
}).count((num) => {
console.log("Users with counter between 1 and 205 and with even counter:
"+ num);
});

Now we can use helper functions like orm.ge, orm.like, ecc in Find
Now it's possible to do thing like
```TypeScript
req.models["users"].find({ "counter": orm.lte(25) }).each((user) => {
console.log(user["counter"]);
});
req.models["users"].find({ "counter": orm.between(1, 205)
}).each().filter((user) => {
return (user["counter"] % 2) === 0;
}).count((num) => {
console.log("Users with counter between 1 and 205 and with even counter:
"+ num);
});
```
dresende added a commit that referenced this pull request Nov 8, 2013
Fix and improve TypeScript declaration
@dresende dresende merged commit f8e238c into dresende:master Nov 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants