As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
I'm running against a wall using lessThanOrEqualTo in Business Logic. I came up to the point that it probably won't work that way (as it does in Javascript API):
var checkDate = 201907241500
logger.info("step 1");
modules.collectionAccess.collection('products').lessThanOrEqualTo(('release.unlockdate', checkDate), function (err, docs) {
if (err) {
logger.error('Query failed: '+ err);
} else {
logger.info ('durch');
}
});
It outputs "step 1" and no further error message.
This f.e. works fine but this is only an equal operation:
var checkDate = 201907241500;
modules.collectionAccess.collection('products').find({"release.unlockdate": checkDate}, function (err, publish) {
logger.info(JSON.stringify(publish));
});
I'm looking for the query function that allows me to search for records with a value equal or less than a given value. Is that possible?
The samples you provided in the documentation are all simple. I couldn't find examples with advanced query logic.
Regards
Best Answer
P
Pranav J
said
over 4 years ago
Hello Tayger,
Please check the following code snippet which shows how to use "Less Than or Equal to" operator:
function onRequest(request, response, modules) {
var logger = modules.logger;
modules.collectionAccess.collection('Book').find({"startDate": {"$lte": "2018-11-02T11:29:44.211Z"}}, function (err, docs) {
if (err) {
logger.error('Query failed: '+ err);
} else {
logger.info('Found records are ' + JSON.stringify(docs));
logger.info('Number of records is ' + docs.length);
response.body = docs;
response.complete(200);
}
});
}
Tayger
Hello
I'm running against a wall using lessThanOrEqualTo in Business Logic. I came up to the point that it probably won't work that way (as it does in Javascript API):
It outputs "step 1" and no further error message.
This f.e. works fine but this is only an equal operation:
I'm looking for the query function that allows me to search for records with a value equal or less than a given value. Is that possible?
The samples you provided in the documentation are all simple. I couldn't find examples with advanced query logic.
Regards
Hello Tayger,
Please check the following code snippet which shows how to use "Less Than or Equal to" operator:
Thanks,
Pranav
Kinvey
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstPranav J
Hello Tayger,
Please check the following code snippet which shows how to use "Less Than or Equal to" operator:
Thanks,
Pranav
Kinvey
Tayger
Wow, this is it, thank you Pranav! It works like a charm! Next time I will consider the MongoDB documentation that exactly reflects that.
Regards
Tay
Gomez
Agreed..It works too good...Thank you so much for the solution
-
How do I access query string values for GET and DELETE requests?
-
Basic Authentication in Business Logic
-
How do I cascade delete entities from related collections?
-
All BL failing with Violation Error
-
How do I send push notifications?
-
Whenever I try to query by _id, I get zero results
-
receiving SOCKETTIMEDOUT when requesting external http response
-
Unique Constraints on a collection column?
-
Need some help with grouping
-
Accessing Endpoint from Collection Hook
See all 342 topics