问题
I want to search a specific enrollment device on DPS (based on its 'OL' tag). For that, I use the next piece of code:
QuerySpecification querySpecification = new QuerySpecificationBuilder("*",QuerySpecificationBuilder.FromType.ENROLLMENTS)
.where("initialTwin.tags.OL='12345678ABCD'")
.createSqlQuery();
Query query = provisioningServiceClient.createIndividualEnrollmentQuery(querySpecification);
But, when I execute query.next() to fetch the results, always is returning all the devices in the DPS.
I've also tried to use the deviceId in the "where" clause but it returns all devices too.
What I'm doing wrong?
回答1:
Currently the service does not support where
clause or any filter options. The best option for now is to retrieve the full list and do a client side filtering.
来源:https://stackoverflow.com/questions/52946958/search-an-enrollment-device-on-device-provisioning-service-via-initialtwin-tag