You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by "Byers, Steven K (Steve) CTR USARMY MEDCOM JMLFDC (US)" <st...@mail.mil> on 2018/10/03 18:52:43 UTC

Is it possible to count records in a MongoDb collection using the GetMongo processor?

Hi everyone,

Is there a way to use the GetMongo processor to count the number of records in 
a collection that has a certain value for a field in the collection?

For example, how would I count the number of documents in the Names collection 
where firstName = Steve?

Thank you,

Steven K. Byers
Perspecta Inc. Contractor
Software Developer - Joint Medical Logistics Functional Development Center 
(JMLFDC)
Defense Health Agency (DHA)/ Health Information Technology (HIT) Directorate/ 
Solution Delivery Division (SDD)/Clinical Support Branch/JMLFDC
1681 Nelson Street, Fort Detrick, MD  21702
(443) 538-7575 | (410) 872-4923
Email:     steven.k.byers.ctr@mail.mil


Re: Is it possible to count records in a MongoDb collection using the GetMongo processor?

Posted by Mike Thomsen <mi...@gmail.com>.
Right now the only way to do it would be to use RunMongoAggregation to do
the aggregation query that counts.

On Wed, Oct 3, 2018 at 2:56 PM Byers, Steven K (Steve) CTR USARMY MEDCOM
JMLFDC (US) <st...@mail.mil> wrote:

>
> Hi everyone,
>
> Is there a way to use the GetMongo processor to count the number of
> records in
> a collection that has a certain value for a field in the collection?
>
> For example, how would I count the number of documents in the Names
> collection
> where firstName = Steve?
>
> Thank you,
>
> Steven K. Byers
> Perspecta Inc. Contractor
> Software Developer - Joint Medical Logistics Functional Development Center
> (JMLFDC)
> Defense Health Agency (DHA)/ Health Information Technology (HIT)
> Directorate/
> Solution Delivery Division (SDD)/Clinical Support Branch/JMLFDC
> 1681 Nelson Street, Fort Detrick, MD  21702
> (443) 538-7575 | (410) 872-4923
> Email:     steven.k.byers.ctr@mail.mil
>
>