Fix: properly handle numeric values from MongoDB documents