You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a minor enhancement release that improves the robustness of NeoSQLite by automatically detecting and correcting common ID type mismatches between integer IDs and ObjectIds. The release enhances user experience by making the API more forgiving of common mistakes while maintaining full backward compatibility.
Highlights
Automatic ID Type Correction
Smart Query Handling: Automatically detects and corrects common ID type mismatches between integer IDs and ObjectIds
User-Friendly API: Makes the API more robust by handling common user errors gracefully
Transparent Operation: Corrections happen automatically without requiring code changes
Full Backward Compatibility: All existing code continues to work unchanged
New Features
Intelligent ID Type Detection
Query Normalization: Automatically normalizes queries when users mistakenly query the id field with ObjectId values
Type Conversion: Converts between integer IDs and ObjectIds based on context and value type
String Handling: Properly handles integer strings and hex strings in ID queries
Cross-Operation Support: Works across all CRUD operations (find, update, delete, etc.)
Automatic Corrections
id field with ObjectId: When users query {'id': ObjectId(...)} it's automatically corrected to search the _id field
id field with hex string: When users query {'id': 'hex_string'} it's automatically corrected to search the _id field
_id field with integer string: When users query {'_id': '123'} it's automatically converted to integer 123
All CRUD Operations: Type correction works seamlessly across find, update, delete, replace, and count operations
Technical Benefits
Enhanced Robustness: Reduces errors from common ID type mismatches
Improved Developer Experience: More forgiving API that handles common mistakes gracefully
Zero Configuration: No code changes required - works automatically
Performance Preserved: Minimal overhead with efficient implementation
Maintainability: Centralized implementation following DRY principles
Migration Notes
No migration is required for this release. All existing code continues to work unchanged while benefiting from the enhanced robustness. The automatic type correction is applied transparently and does not affect any existing functionality.
Example Improvements
# Before v1.1.1 - These might cause confusion or require manual handling:docs=collection.find({'id': some_object_id}) # User mistake - querying id with ObjectIddocs=collection.find({'id': str(some_object_id)}) # User mistake - querying id with hex stringdocs=collection.find({'_id': '123'}) # User mistake - querying _id with integer string# After v1.1.1 - All of these work automatically and correctly:docs=collection.find({'id': some_object_id}) # Automatically corrected to {'_id': 'hex_string'}docs=collection.find({'id': str(some_object_id)}) # Automatically corrected to {'_id': 'hex_string'} docs=collection.find({'_id': '123'}) # Automatically corrected to {'_id': 123}# All operations benefit from automatic correction:collection.update_one({'id': some_object_id}, {'$set': {'updated': True}}) # Works automaticallycollection.delete_one({'id': str(some_object_id)}) # Works automaticallycount=collection.count_documents({'id': some_object_id}) # Works automatically
Installation
# Standard installation
pip install neosqlite==1.1.1
# For enhanced JSON/JSONB support
pip install neosqlite[jsonb]==1.1.1
# For memory-constrained processing of large result sets
pip install neosqlite[memory-constrained]==1.1.1
# Install multiple extras
pip install neosqlite[jsonb,memory-constrained]==1.1.1
This release represents a refinement of the NeoSQLite experience, making the API more robust and user-friendly while maintaining full compatibility with existing code. The automatic ID type correction helps prevent common mistakes and makes working with both integer IDs and ObjectIds more intuitive.
This discussion was created from the release v1.1.1.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
NeoSQLite v1.1.1 Release Notes
Overview
This is a minor enhancement release that improves the robustness of NeoSQLite by automatically detecting and correcting common ID type mismatches between integer IDs and ObjectIds. The release enhances user experience by making the API more forgiving of common mistakes while maintaining full backward compatibility.
Highlights
Automatic ID Type Correction
New Features
Intelligent ID Type Detection
idfield with ObjectId valuesAutomatic Corrections
idfield with ObjectId: When users query{'id': ObjectId(...)}it's automatically corrected to search the_idfieldidfield with hex string: When users query{'id': 'hex_string'}it's automatically corrected to search the_idfield_idfield with integer string: When users query{'_id': '123'}it's automatically converted to integer123Technical Benefits
Migration Notes
No migration is required for this release. All existing code continues to work unchanged while benefiting from the enhanced robustness. The automatic type correction is applied transparently and does not affect any existing functionality.
Example Improvements
Installation
This release represents a refinement of the NeoSQLite experience, making the API more robust and user-friendly while maintaining full compatibility with existing code. The automatic ID type correction helps prevent common mistakes and makes working with both integer IDs and ObjectIds more intuitive.
This discussion was created from the release v1.1.1.
Beta Was this translation helpful? Give feedback.
All reactions