monSQLize chain calling method support documentation
Overview
Now you can build queries using chained calls just like you would with the native MongoDB driver. Chained methods fully support caching, parameter validation and error handling.
🎯 Supported chain calling method (completely implemented)
1. find() method
✅ Supported chain calls (12 methods in total)
limit(0) intentionally keeps the MongoDB cursor semantics: it means "no limit" and may return all matching documents. Use a positive limit for bounded reads; explicit positive limits are capped by findMaxLimit.
📝 Usage example
2. aggregate() method
✅ Supported chain calls (9 methods in total)
📝 Usage example (2. aggregate() method)
🆚 MongoDB native chain method comparison
Complete comparison table
Summary: monSQLize v3 supports the 12 chaining methods listed above. Use the table as the capability contract; application coverage depends on the query patterns your service uses.
✨ Highlights of new features
1. Promise compatibility
The chained call object implements the complete Promise interface:
2. Automatic parameter verification
3. Execution protection
To prevent accidental re-execution:
4. Full cache support
The chained call uses the same cache key as the options parameter:
🔄 Backwards Compatibility
100% backwards compatible
All existing code without modification:
Automatic detection
monSQLize will automatically detect the calling method:
- No options parameter → return chain builder
- with options parameter → execute query directly
📚 Related documents
- Chain call complete API documentation - Detailed usage guide and best practices
- Chain call example - Current TypeScript example
- find method document - find method detailed description
- aggregate method document - detailed description of aggregate method
- explain method document - Performance analysis tool
Feedback and Suggestions: If you have questions or suggestions, please submit GitHub Issue.