NgRx Auto-Entity
Primary version
Primary version
  • NgRx Auto-Entity
  • Getting Started
    • Installation
    • Quick Start
    • Use your State!
      • Enhancing your Facade
      • Simplify your Component
    • From Scratch
      • App Interfaces
      • App Reducer
      • App State Module
      • Entity Model
      • Entity State
      • Update App State
      • Entity Service
      • Update App Module
  • Advanced Topics
    • Advanced Usage
      • Paradigm Changes
        • Models
        • Services
        • Service Providers
      • Taking Control
        • Integrating Custom Effects
      • Building Your Entities
        • Entity Names
        • Sort Comparers
        • Data Transforms
      • Building Your Entity States
        • The buildState() function
        • The buildFeatureState() function
        • The IEntityState Interface
        • The Selector Map
      • Generic Actions
        • Actions Now
        • Reusable Generic Actions
        • Custom Criteria
        • Loading Actions
          • Loading Entities
          • Loading Pages
          • Loading Ranges
        • Optional Loading
        • CURD Actions
        • Utility Actions
      • Correlation
      • Common Selectors
        • Exporting Selectors
      • Extra Selectors
      • Custom Selectors
        • Adding to Facades
        • Using Custom Selectors
      • Custom Effects
        • Composing Actions
        • Workflows
    • Leveraging Facades
      • Preparing Facades
      • The Interface: Selections
        • Using Facade Selections
        • Simplifying Further
      • The Interface: Activities
        • Using Facade Activities
      • So Little Code!
    • Utility Functions
      • Prototyping your Entities
        • Entity Making Performance
      • Entity Name Utilities
      • Entity Key Utilities
      • Entity Comparers
  • Examples
    • Sample Application
      • App Module
      • State
      • Models
      • Services
      • Facades
      • Container Components
      • Presentation Components
      • Modal Component
  • Documentation
    • Reference
  • Extras
    • Github Link
Powered by GitBook
On this page
  • CUURD, not CRUD??
  • Upsert: Update or Insert
  • Bulk Actions Supported
Export as PDF
  1. Advanced Topics
  2. Advanced Usage
  3. Generic Actions

CURD Actions

Create, Update, REPLACE & Delete

First off, you may be wondering why I am trying to coin a new term here. CUURD? "Ain't it supposed to be CRUD?!" you say? Just wait till you hear the full "new" acronym! CUURDL! Ah, the cow jokes that could be made... Well, CUURDL, because: Create, Update, Upsert, Replace, Delete & Load! These are the core actions supported by Auto-Entity, and they span the range of common entity-related behaviors.

CUURD, not CRUD??

CRUD in the past has stood for Create, Read, Update, Delete. This was a fairly standard term, however one of the goals of NgRx Auto-Entity is to fully support the entire range of HTTP/REST methods currently standardized. This includes both PUT and PATCH, which now have the semantics of "Replace in Whole" vs. "Update in Part." Auto-Entity provides actions to support both methods concurrently, required.

  • Create: Create a single entity [POST]

  • CreateMany: Create multiple entities (batch) [POST]

  • Update: Update a single entity [PATCH]

  • UpdateMany: Update multiple entities (batch) [PATCH]

  • Upsert: Update or insert a single entity [PUT]

  • UpsertMany: Update or insert multiple entities [PUT]

  • Replace: Replace a single entity [PUT]

  • ReplaceMany: Replace many entities (batch) [PUT]

  • Delete: Delete a single entity [DELETE]

  • DeleteMany: Delete many entities (batch) [DELETE]

Upsert: Update or Insert

Some data stores support the concept of a sort of "merge" operation, where data may be updated, or inserted, as appropriate based on keys and what exists already vs. not. MongoDB is an example of one database that has first-class upsert support in many of its operations.

Auto-Entity provides first-class support for upsert operations. This means that when upsert responses are reduced, they will be properly merged into the existing state, updating existing keys or adding new keys as appropriate.

Bulk Actions Supported

Aside from supporting a full set of CURD actions for singular entities, we also support batch/bulk CURD actions allowing the creation, update/replacement and deletion of multiple entities at once.

PreviousOptional LoadingNextUtility Actions

Last updated 4 years ago