Function unescapeFieldPath

  • Overview

    Splits a field path into its individual segments, accounting for potentially escaped characters.

    ✏️Note: This is not the exact inverse of escapeFieldNames, as while the former may encode numbers into strings, this function will always return strings.

    Parameters

    • path: string

    Returns string[]

    Example

    import { unescapeFieldPath } from '@datastax/astra-db-ts';

    // ['websites', 'www.datastax.com', 'visits']
    unescapeFieldPath('websites.www&.datastax&.com.visits')

    // ['shows', 'tom&jerry', 'episodes', '3', 'views']
    unescapeFieldPath('shows.tom&&jerry.episodes.3.views')