Finally, I found the answer to my problem. Theoretically, longitude is the x axis, and latitude is the y axis. But we are used to latitude - longitude, not longitude - latitude ... So I was looking for the wrong
$near : [msg.lat, msg.lng]
When I changed this to $ near: [msg.lng, msg.lat] , it even started working with 5KM ... So the problem was in the order.
user644745
source share