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

Fixes for queries examples in README. #22

Merged
merged 2 commits into from
Jul 20, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ You can sort the results by a property name ascendingly or descendingly.

~~~~ js
// sorts by size ascendingly.
var q = ds.createQuery('Company').sort('+size');
var q = ds.createQuery('Company').order('+size');

// sorts by size descendingly.
var q = ds.createQuery('Company').sort('-size');
var q = ds.createQuery('Company').order('-size');
~~~~

##### Selection (or Projection)
Expand All @@ -205,7 +205,7 @@ Pagination allows you to set an offset, limit and starting cursor to a query.

~~~~ js
var q = ds.createQuery('Company')
.offset(100) // start from 100th result
.offset(100) // start from 101th result
.limit(10) // return only 10 results
.start(cursorToken); // continue to retrieve results from the given cursor.
~~~~
Expand Down
2 changes: 1 addition & 1 deletion lib/datastore/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var keyToKeyProto = function(datasetId, key) {
}
var namespace = null, start = 0;
if (key.length % 2 == 1) {
// the first item is the namepsace
// the first item is the namespace
namespace = key[0];
start = 1;
}
Expand Down