Compass : How to query a long field?

Schema

I tried both below , and i got zero results,how to fix this?

{messageid : 655890431938265092}
and 
{messageid : NumberLong("655890431938265092")}

I am using compass version 1.21.2 , on ubuntu 20.04 LTS

Hi @Takis,

It’s working fine for me with MongoDB Compass 1.26.1 (current prod version).

image

Are you sure that your messageid is actually stored as a NumberLong value?

You can double check by clicking here or here in the UI (see red arrows).

image

FYI, this is how I inserted the document in MongoDB from the shell:

db.coll.insert({messageid: NumberLong("123456789987654321")})

Cheers,
Maxime.

2 Likes

MongoDB Compass 1.26.1 with linux all works,i tried so many times with older versions.
I dont believe i did typos all this time,but can’t be sure.
Thank you for the reply.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.