极限数mongodb输入中的行数 [英] Limit no. of rows in mongodb input

查看:118
本文介绍了极限数mongodb输入中的行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何限制编号在水壶中使用的mongodb输入转换中检索到的行数.

How to limit the no. of rows retrieved in mongodb input transformation used in kettle.

我在mongodb输入查询中尝试了以下查询,但没有一个起作用:

I tried in mongodb input query with below queries but none of them are working :

{"$ query":{"$ limit":10}} 或{"$ limit":10}

{"$query" : {"$limit" : 10}} or {"$limit" : 10}

请让我知道我要去哪里了.

Please let me know where i am going wrong.

谢谢, Deepthi

Thanks, Deepthi

推荐答案

有几个查询修改运算符.它们的名称并不完全直观,并且与您在Mongo Shell中使用的函数的名称不匹配,但是它们执行的功能相同.

There are several query modification operators you can use. Their names are not totally intuitive and don't match the names of functions you would use in the Mongo shell, but they do the same sorts of things.

在您的情况下,您需要$maxScan运算符.您可以将查询写为:

In your case, you need the $maxScan operator. You could write your query as:

{"$query": {...}, "$maxScan": 10}

这篇关于极限数mongodb输入中的行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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