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 read on another post, that you changed policies on regular expressions and that they must have an anchor at the beginning. Is it right?
Since that one was in "REST API" section of the forum, I opened a new one on Business Logic that fits more my question.
I'm trying to fix my queries, but I can't find a solution... earlier on I used something like this:
var query = {'name': { $regex: searchString, $options: 'i' }};
modules..collectionAccess.collection('Collection').find(query, function (err, docs) { } });
Doesn't matter about the case-insensitive option, I'll find a way around, like the one suggested in the other post, but at least how should I rewrite the query to find every document where the 'name' field begins with searchString?
I tried solutions like these but they're not working...
var query = {'name': { $regex: '^searchString' }};
var query = {'name': { $regex: /^searchString/ }};
Uhhh... I understand now. The string associated to Regex now is an actual string that contains escape characters... while my searchString is a variable itself.
So I just needed to create the string merging searchString with escape characters.
I tried now with
var query = {'name': { $regex: '^' + searchString }};
and works :)
Thanks Gal :) your '^T' gave the right hint, cause I thought "T is a weird name for a variable...uhh it's an actual string!" :D
Davide Neri
Since that one was in "REST API" section of the forum, I opened a new one on Business Logic that fits more my question.
I'm trying to fix my queries, but I can't find a solution... earlier on I used something like this:
var query = {'name': { $regex: searchString, $options: 'i' }};
modules..collectionAccess.collection('Collection').find(query, function (err, docs) { } });
Doesn't matter about the case-insensitive option, I'll find a way around, like the one suggested in the other post, but at least how should I rewrite the query to find every document where the 'name' field begins with searchString?
I tried solutions like these but they're not working...
var query = {'name': { $regex: '^searchString' }};
var query = {'name': { $regex: /^searchString/ }};
Thanks :)