Skip to content

Commit

Permalink
Revert "fixing case on orderBy"
Browse files Browse the repository at this point in the history
This reverts commit 2a59428.
  • Loading branch information
Ryan Kotzen authored and Ryan Kotzen committed Jun 18, 2024
1 parent c254e93 commit 58a5bd6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const MongoQuery = require('./MongoQuery.js');

const _defaultQueryTimeoutMS = 120000;

// const _specialFields = ['$select', '$limit', '$top', '$filter', '$skip', '$sort', '$orderBy', '$rawQuery', '$aggregate', '$group'];
// const _specialFields = ['$select', '$limit', '$top', '$filter', '$skip', '$sort', '$orderby', '$rawQuery', '$aggregate', '$group'];
/**
* @typedef {import('mongodb').EstimatedDocumentCountOptions} EstimatedDocumentCountOptions
* @typedef {import('mongodb').CountDocumentsOptions} CountDocumentsOptions
Expand Down
2 changes: 1 addition & 1 deletion lib/MongoQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function getSelect(query) {
* @template {Document} TSchema
*/
function getSortOrOrderBy(query) {
const sortStr = query.$orderBy || query.$orderby || query.$sort;
const sortStr = query.$orderby ? query.$orderby : query.$sort;
if (!sortStr) {
return null;
}
Expand Down
11 changes: 3 additions & 8 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@ export interface Query<TSchema extends Document> {
* $orderBy: "+name,-description,price desc,date asc,index"
* }
* */
$orderBy?: string;
$orderby?: string;
/**
* @deprecated incorrect spelling of $orderBy, will be removed in future
* @alias $orderBy
* */
$ordery?: string;
/**
* $orderBy takes priority over $sort, see it for docs
* @alias $orderBy
* $orderby takes priority over $sort, see it for docs
* @alias $orderby
*/
$sort?: string;
/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@synatic/mongo-magic",
"version": "2.2.1",
"version": "2.2.0",
"description": "Synatic utility classes for interacting with MongoDB",
"main": "index.js",
"files": [
Expand Down

0 comments on commit 58a5bd6

Please sign in to comment.