On mongodb api "getRecords()", can i get meta data count as the only response?


#1

Hello!

On mongodb api “getRecords()”, can i get meta data count as the only response? or can I write a script to do that? if anyone know how I can filter or remove resource completely with its response it would be great, thanks! Because I kept getting all or list of filtered id records along with metadata with count.

thanks,

Ivan


#2

It looks like MongoDB doesn’t support Stored Procedures, which would have been my first suggestion.

As an alternative, you can call getRecords() with include_count=true and offset=1000000000 or some other very large number (compared to your expected table size). It’s very hacky, so hopefully someone can come up with a better solution.


#3

I will give it a try mlucas thanks!


#4

hi all
my post will maybe be ridiculous, because i’ve maybe misunderstood,
but

as you wil get a json as a result (called response for example)

response.lenght will be your count

jb