Finds resources in a collection that match search criteria and gets a representation of each matching resource.
There are multiple variations of this method:
object resourceFind(array resourceId, array findNames, array findValues)
object resourceFind(array resourceId, array findNames, array findValues, array names)
- Parameters
-
[in] | resourceId | Resource ID of the resource to search. |
[in] | findNames | Properties that must have a specific value. |
[in] | findValues | Values each property must have. |
[in] | names | Properties to return. |
- Returns
- The return value is a JSON object.
- The return value has an array named
items
. Each array item is a JSON object representation of a matching resource.
- If items have auto-generated bookmarks, the return value has an array of bookmarks for the items named
itemBookmarks
.
- Usage
- The resource must be a collection.
- The search is case insensitive.
- If
names
is not an empty array, property names are returned in the same case specified. If names
is an empty array or missing, all properties are returned.
Examples
C#
jsonReply = call.resourceFind(
new string[] { "addressTables", "2736298458", "records" },
new string[] { "COMPANY" },
new string[] { "XYZ Company" },
new string[] { "COMPANY", "STATE" }
);
Python
1 jsonReply = call.resourceFind(
2 [
"addressTables",
"2736298458",
"records" ],
Request
{
"method" : "resourceFind",
"params" : [
[ "addressTables", "2736298458", "records" ],
[ "COMPANY" ],
[ "XYZ Company" ],
[ "COMPANY", "STATE" ]
]
}
Reply
{
"result" :
{
"items" : [
{
"COMPANY" : "XYZ Company",
"STATE" : "NY"
},
{
"COMPANY" : "XYZ Company",
"STATE" : "OH"
}
],
"itemBookmarks" : [
"AgAAAA==",
"AwAAAA=="
]
}
}