本文介绍了通过initialTwin标签在Device Provisioning Service上搜索注册设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在DPS上搜索特定的注册设备(基于其"OL"标签).为此,我使用下一段代码:

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);

但是,当我执行query.next()来获取结果时,总是返回DPS中的所有设备.

But, when I execute query.next() to fetch the results, always is returning all the devices in the DPS.

我还尝试在"where"子句中使用deviceId,但它也会返回所有设备.

I've also tried to use the deviceId in the "where" clause but it returns all devices too.

我做错了什么?

推荐答案

当前服务不支持where子句或任何过滤器选项.目前最好的选择是检索完整列表并进行客户端过滤.

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.

这篇关于通过initialTwin标签在Device Provisioning Service上搜索注册设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 18:19