在Breeze.js计数 [英] Counts in Breeze.js

查看:155
本文介绍了在Breeze.js计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个复杂的查询,返回项目计数。如果我在客户端上运行一个查询,将它始终返回的对象,或者是有没有办法只返回项目计数无有效载荷发送对象数组?我试图做类似

I have a complex query that returns item counts. If I run a query on the client, will it always return the objects, or is there a way to just return the item counts without sending the object array in the payload? I tried doing something like

var query = breeze.EntityQuery.from('Items').inlineCount(true);

但仍然拉的所有记录下来。任何解决方案?

but that still pulls all the records down. Any solutions?

推荐答案

我不知道这是否正是回答你的问题,但你需要查询才能知道有多少(据我所知纪录,有可能是一个更有效的方式,以配合微风直接到SQL命令是远远超过我的头),所以你可以这样做 -

I don't know if this exactly answers your question, but you would need to query the records in order to know how many there are (to my knowledge, there may be a more efficient way to tie Breeze directly into a SQL command that is way over my head) so you could do something like -

var query = breeze.EntityQuery.from('Items')
    .take(0)
    .inlineCount(true);

编辑答案 - 这将不返回任何对象,并简单地得到计数

Edited the answer - this would return no objects and simply get the count.

这篇关于在Breeze.js计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆