apoc.mongodb.count

Procedure APOC Full Deprecated

apoc.mongodb.count(host-or-key,db,collection,query) yield value - perform a find operation on mongodb collection

Signature

apoc.mongodb.count(host :: STRING?, db :: STRING?, collection :: STRING?, query :: MAP?) :: (value :: INTEGER?)

Input parameters

Name Type Default

host

STRING?

null

db

STRING?

null

collection

STRING?

null

query

MAP?

null

Output parameters

Name Type

value

INTEGER?

Install Dependencies

The Mongo procedures have dependencies on a client library that is not included in the APOC Library.

This dependency is included in apoc-mongodb-dependencies-4.1.0.11.jar, which can be downloaded from the releases page. Once that file is downloaded, it should be placed in the plugins directory and the Neo4j Server restarted.

Usage Examples

The examples in this section are based on a Mongo DB instance with a pre-populate twitter dataset. You can find instructions for setting this up at github.com/neo4j-examples/mongo-example.

Cypher
CALL apoc.mongodb.count('mongodb://mongo:neo4j@mongo:27017', 'test', 'tweets', {});
Table 1. Results
value

966