Welcome to the community @97vaqasazeem_N_A,
Can you provide an example of the query you are trying to run? By “native query”, are you referring to a JavaScript query in the mongo shell?
The Java driver provides a full interface for querying MongoDB. To get started, see MongoDB Java Driver Quick Start and the Java Driver Tutorials.
Regards,
Stennie