You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
452 B
JavaScript

"use strict";
let pluginLimit = {
name: "npm:raqb:limit",
methods: {
limit: {
applyBuilder: function (query, [ limit ]) {
return query.internalSingleState({ limit: limit });
},
prepareQueryOnce: (query) => {
}
}
}
};
let pluginFirst = {
name: "npm:raqb:first",
methods: {
first: {
applyBuilder: function (query) {
return query.limit(1);
},
processResult: (result) => {
return result[0];
}
}
}
};