Big Data & Tools with NoSQL
  • Big Data & Tools
  • ReadMe
  • Big Data Overview
    • Overview
    • Job Opportunities
    • What is Data?
    • How does it help?
    • Types of Data
    • The Big 4 V's
      • Variety
      • Volume
      • Velocity
      • Veracity
      • Other V's
    • Trending Technologies
    • Big Data Concerns
    • Big Data Challenges
    • Data Integration
    • Scaling
      • CAP Theorem
      • Optimistic concurrency
      • Eventual consistency
      • Concurrent vs. Parallel Programming
    • Big Data Tools
    • No SQL Databases
    • What does Big Data learning means?
  • Linux & Tools
    • Overview
    • Linux Commands - 01
    • Linux Commands - 02
    • AWK
    • CSVKIT
    • CSVSQL
    • CSVGREP
  • Data Format
    • Storage Formats
    • CSV/TSV/Parquet
    • Parquet Example
    • JSON
    • HTTP & REST API
      • Terms to Know
        • Statefulness
        • Statelessness
        • Monolithic Architecture
        • Microservices
        • Idempotency
    • REST API
    • Python
      • Setup
      • Decorator
      • Unit Testing
      • Flask Demo
      • Flask Demo - 01
      • Flask Demo - 02
      • Flask Demo - 03
      • Flask Demo - 04
      • Flask Demo - 06
    • API Testing
    • Flask Demo Testing
    • API Performance
    • API in Big Data World
  • NoSQL
    • Types of NoSQL Databases
    • Redis
      • Overview
      • Terms to know
      • Redis - (RDBMS) MySql
      • Redis Cache Demo
      • Use Cases
      • Data Structures
        • Strings
        • List
        • Set
        • Hash
        • Geospatial Index
        • Pub/Sub
        • Redis - Python
      • Redis JSON
      • Redis Search
      • Persistence
      • Databases
      • Timeseries
    • Neo4J
      • Introduction
      • Neo4J Terms
      • Software
      • Neo4J Components
      • Hello World
      • Examples
        • MySQL: Neo4J
        • Sample Transactions
        • Sample
        • Create Nodes
        • Update Nodes
        • Relation
        • Putting it all together
        • Commonly used Functions
        • Data Profiling
        • Queries
        • Python Scripts
      • More reading
    • MongoDB
      • Sample JSON
      • Introduction
      • Software
      • MongoDB Best Practices
      • MongoDB Commands
      • Insert Document
      • Querying MongoDB
      • Update & Remove
      • Import
      • Logical Operators
      • Data Types
      • Operators
      • Aggregation Pipeline
      • Further Reading
      • Fun Task
        • Sample
    • InfluxDB
      • Data Format
      • Scripts
  • Python
    • Python Classes
    • Serialization-Deserialization
  • Tools
    • JQ
    • DUCK DB
    • CICD Intro
    • CICD Tools
      • CI YAML
      • CD Yaml
    • Containers
      • VMs or Containers
      • What container does
      • Podman
      • Podman Examples
  • Cloud Everywhere
    • Overview
    • Types of Cloud Services
    • Challenges of Cloud Computing
    • High Availability
    • Azure Cloud
      • Services
      • Storages
      • Demo
    • Terraform
  • Data Engineering
    • Batch vs Streaming
    • Kafka
      • Introduction
      • Kafka Use Cases
      • Kafka Software
      • Python Scripts
      • Different types of Streaming
    • Quality & Governance
    • Medallion Architecture
    • Data Engineering Model
    • Data Mesh
  • Industry Trends
    • Roadmap - Data Engineer
    • Good Reads
      • IP & SUBNET
Powered by GitBook
On this page
  1. NoSQL
  2. Redis

Redis JSON

Redis Stack extends the core features of Redis OSS and provides a complete developer experience for debugging and more.

RedisJSON

RedisGraph

RedisTimeseries

RedisSearch

The JSON capability of Redis Stack provides JavaScript Object Notation (JSON) support for Redis. It lets you store, update, and retrieve JSON values in a Redis database, similar to any other Redis data type.

JSON.SET friends:character:rachel $ '{"name": "Rachel Green", "occupation": "Fashion Executive", "relationship_status": "Single", "friends": ["Ross Geller", "Monica Geller", "Joey Tribbiani", "Chandler Bing", "Phoebe Buffay"] }'

Dollar sign ($) represents the Root node

JSON.GET friends:character:rachel

Retrieve Specific fields

JSON.GET friends:character:rachel $.name $.occupation

Adds education at the end

JSON.SET friends:character:rachel $.education '
{"high_school": "Lincoln High School", "college": "Not specified" }'
JSON.GET friends:character:rachel

Adding Array of values

JSON.SET friends:character:rachel $.employment_history '[ { "company": "Central Perk", "position": "Waitress", "years": "1994-1995" }, { "company": "Bloomingdale\'s", "position": "Assistant Buyer", "years": "1996-1999" }, { "company": "Ralph Lauren", "position": "Executive", "years": "1999-2004" } ]'

Get Employment History

json.get friends:character:rachel employment_history
JSON.GET friends:character:rachel $.employment_history[*].company

Get specific one

json.get friends:character:rachel employment_history[1]

Scan All Keys

SCAN 0 MATCH friends:character:*

Add more data

JSON.SET friends:character:ross $ '{
  "name": "Ross Geller",
  "occupation": "Paleontologist",
  "relationship_status": "Divorced",
  "friends": ["Rachel Green", "Monica Geller", "Joey Tribbiani", "Chandler Bing", "Phoebe Buffay"],
  "children": [
    {
      "name": "Ben Geller",
      "mother": "Carol Willick"
    },
    {
      "name": "Emma Geller-Green",
      "mother": "Rachel Green"
    }
  ],
  "education": {
    "college": "Columbia University",
    "degree": "Ph.D. in Paleontology"
  }}'
JSON.SET friends:character:monica $ '{
  "name": "Monica Geller",
  "occupation": "Chef",
  "relationship_status": "Married",
  "friends": ["Ross Geller", "Rachel Green", "Joey Tribbiani", "Chandler Bing", "Phoebe Buffay"],
  "spouse": "Chandler Bing",
  "education": {
    "culinary_school": "Not specified"
  },
  "employment_history": [
    {
      "company": "Alessandro\'s",
      "position": "Head Chef",
      "years": "Not specified"
    },
    {
      "company": "Javu",
      "position": "Chef",
      "years": "Not specified"
    }
  ]}'
JSON.GET friends:character:ross $.name $.occupation
JSON.SET friends:character:chandler $ '{
  "name": "Chandler Bing",
  "occupation": "Statistical analysis and data reconfiguration",
  "relationship_status": "Married",
  "friends": ["Ross Geller", "Monica Geller", "Joey Tribbiani", "Rachel Green", "Phoebe Buffay"],
  "spouse": "Monica Geller",
  "education": {
    "college": "Not specified"
  }}'
JSON.SET friends:character:phoebe $ '{
  "name": "Phoebe Buffay",
  "occupation": "Masseuse and Musician",
  "relationship_status": "Married",
  "friends": ["Ross Geller", "Monica Geller", "Joey Tribbiani", "Chandler Bing", "Rachel Green"],
  "spouse": "Mike Hannigan",
  "education": {
    "high_school": "Not completed"
  }}'
JSON.SET friends:character:joey $ '{
  "name": "Joey Tribbiani",
  "occupation": "Actor",
  "relationship_status": "Single",
  "friends": ["Ross Geller", "Monica Geller", "Chandler Bing", "Rachel Green", "Phoebe Buffay"],
  "education": {
    "drama_school": "Not specified"
  },
  "employment_history": [
    {
      "show": "Days of Our Lives",
      "role": "Dr. Drake Ramoray",
      "years": "Various"
    }
  ]}'

Delete specific node

JSON.DEL friends:character:monica $.occupation
PreviousRedis - PythonNextRedis Search

Last updated 1 year ago