Skip to content

v3.1.0 - Role Management, Schema Tools & Atlas Search

Choose a tag to compare

@AdrianCurtin AdrianCurtin released this 09 Jan 02:16
· 61 commits to master since this release

Role Management, Schema Tools & Atlas Search

This release adds enhanced role management, schema introspection tools, MongoDB Atlas Search integration, and direct MongoDB query support.

Note: This release also includes changes from v3.0.2 (GitHub release was skipped for that version).

Enhanced Role Management

New helper methods for managing Parse roles and role hierarchies:

# Find or create a role
admin = Parse::Role.find_or_create("Admin")

# Add/remove users
admin.add_users(user1, user2).save
admin.remove_user(user).save

# Check membership
admin.has_user?(user)  # => true

# Role hierarchy
admin.add_child_role(moderator).save
admin.all_child_roles   # => [moderator, ...]
admin.all_users         # => Users from this role AND child roles

HTTP 429 Retry-After Header Support

The client now respects the Retry-After HTTP header when handling rate limit responses. Supports both integer seconds and HTTP-date formats.

MongoDB Read Preference Support

Direct read queries to secondary replicas for load balancing:

songs = Song.query.read_pref(:secondary).where(genre: "Rock").results

Schema Introspection and Migration Tools

New Parse::Schema module for inspecting and migrating schemas:

# Fetch and inspect schema
schema = Parse::Schema.fetch("Song")
schema.field_names      # => ["objectId", "title", "duration", ...]
schema.field_type(:title)  # => :string

# Compare local model with server
diff = Parse::Schema.diff(Song)
diff.summary            # => Human-readable diff

# Generate and apply migration
migration = Parse::Schema.migration(Song)
migration.apply!(dry_run: true)  # Preview only

MongoDB Atlas Search Integration

Full-text search, autocomplete, and faceted search via MongoDB Atlas Search:

# Configure
Parse::MongoDB.configure(uri: "mongodb+srv://...", enabled: true)
Parse::AtlasSearch.configure(enabled: true, default_index: "default")

# Full-text search
result = Parse::AtlasSearch.search("Song", "love ballad")

# Autocomplete
result = Parse::AtlasSearch.autocomplete("Song", "Lov", field: :title)

# Faceted search
result = Parse::AtlasSearch.faceted_search("Song", "rock", facets)

Direct MongoDB Query Methods

New methods for executing queries directly against MongoDB:

songs = Song.query(:plays.gt => 1000).results_direct
song = Song.query.order(:plays.desc).first_direct
count = Song.query(:plays.gt => 1000).count_direct

Also Includes Changes from v3.0.2 (GitHub release skipped)

Push Notification User/Installation Targeting

Parse::Push.to_user(current_user).with_alert("Hello!").send!
Parse::Push.to_users(user1, user2, user3).with_alert("Group message!").send!
Parse::Push.to_installation(device).with_alert("Hello!").send!

Bug Fixes from v3.0.2

  • FIXED: Array constraint field name formatting for MongoDB aggregation queries
  • FIXED: All 13 array constraints now use proper field name conversion (empty_or_nil, not_empty, set_equals, etc.)
  • FIXED: build_aggregation_pipeline now merges all $match stages correctly

Author: Adrian Curtin
Date: December 2025