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.
How is the deviceID populated? Is it based off of the _id of another collection? If so, you may need to convert your string into an objectID as follows:
```
var findPatern = { "deviceID" : collectionAccess.objectID("ABC12345") };
```
Also, make sure your case matches for both the key and the value of your findPattern query. For example, if the actual collection attribute name is deviceId, or deviceid, your query pattern will find zero records. The same is true for the value. ABC12345 is different than abc12345.
Y
Yordan
said
over 9 years ago
deviceID is just a name, it is not foreign key or something.
It's populated with just a text like "Nokia3510".
M
Michael
said
over 9 years ago
Can you paste in the entity that contains deviceID = 'ABC12345'?
Y
Yordan
said
over 9 years ago
I am not sure what You are asking for.
Please explain.
M
Michael
said
over 9 years ago
Specifically, can you provide the actual data record from the collection that contains the info you are searching on, as well as the actual query object.
Y
Yordan
said
over 9 years ago
I did. Everything above is the real code, with a real test string.
M
Michael
said
over 9 years ago
Yordan,
What I'm specifically looking for is to see what the record that this query condition looks like.
```
var findPatern = { "deviceID" : "ABC12345" };
```
Can you query the record through the API Console and paste the results here?
Y
Yordan
said
over 9 years ago
Actually seems like it is related to another unreasonable issue, i've just posted question on.
Yordan
The follow code does not works ( does not finding any match.
Please Help.
function onRequest(request, response, modules)
{
var objectFound;
var findPatern = { "deviceID" : "ABC12345" };
var db = modules.collectionAccess.collection('Clients');
db.findOne( findPatern,
function( error, retrievedEntity )
{
if( error )
{
return response.error(error);
}
if( retrievedEntity === null )
{
return response.error('No matching entity found.');
}
else
{
response.body = retrievedEntity;
response.complete(200);
//objectFound = retrievedEntity;
}
}
);
}