0

我正在使用Android Studio并与基于云的Azure数据库交谈。我知道50的查询限制,并想要绕过这个。我用这个查询:如何使用Azure Mobile检索超过50个项目

private List<ItemInfo> retrieveItemNumList() throws ExecutionException, InterruptedException { 
    return mItemInfoTable.select("Item_Number", "Item_Description").execute().get(); 
} 

我已经找到解决方案,如:

[Queryable(MaxTop = 1000)] 
public IQueryable<Place> GetAll() 

然而,这是一个.NET解决方案,同时我使用Node.js的另外,我是一个完整的noob,所以我不知道如何访问Azure的后端功能。有人可以通过如何启用1000查询来引导我吗?

谢谢。

回答

0

@JamieWang,您可以使用函数MobileServiceTable.top(int top)到集的记录数返回。

如果没有top功能,根据REST API here的描述,

默认情况下,移动服务仅返回50在查询记录。

作为参考,有一个官方的教程,你可以参考款:部分How to: Query data from a mobile service的“如何在页面返回的数据”就知道如何使用。

所以你的代码应该修改如下。

private List<ItemInfo> retrieveItemNumList() throws ExecutionException, InterruptedException { 
    return mItemInfoTable.select("Item_Number", "Item_Description").top(1000).execute().get(); 
} 
+0

谢谢!这工作。 –

相关问题