I am executing a query from Primary and then Secondary, the order (sequence of the result is different).
When I am executing a query using _id sort, then the order is same.
I there anyway we can have same query results without doing sorting on _id field.
If no sort condition is specified, natural ordering is used by mongodb.
This is internal implementation so relying on this order is almost always bad practice. You should explicitly use a sort (e.g. on _id). Otherwise the order of returned docs is nondeterministic.