Skip to content

Removed logger & Added mapSchema function#70

Closed
Didas-git wants to merge 9 commits into
redis:nested-objectsfrom
Didas-git:nested-objects
Closed

Removed logger & Added mapSchema function#70
Didas-git wants to merge 9 commits into
redis:nested-objectsfrom
Didas-git:nested-objects

Conversation

@Didas-git
Copy link
Copy Markdown
Contributor

In my opinion it wasnt a proper logger, also console.info and console.debug are alias to console.log they dont do anything else

In my opinion it wasnt a proper logger, also `console.info` and `console.debug` are alias to `console.log` they dont do anything else
@Didas-git Didas-git changed the title Removed logger Removed logger and add helperr function Apr 22, 2022
@Didas-git
Copy link
Copy Markdown
Contributor Author

Didas-git commented Apr 22, 2022

de8a580 addresses #25
and helps ts devs with a faster way to handle the types for their Entities. This is a temporary way of doing it but i decided to commit it because to make it a feature of the lib would break backwards compatibility.
Usage:

import { Entity, mapSchema, Schema, SchemaDefinition } from "redis-om";

type AlbumSchema = typeof albumSchemaDef;
interface Album extends AlbumSchema { };
class Album extends Entity { };

const albumSchemaDef = mapSchema({
    artist: { type: 'string' },
    title: { type: 'text' },
    year: { type: 'number' },
    genres: { type: 'array' },
    outOfPublication: { type: 'boolean' }
})

const albumSchema = new Schema(Album, <SchemaDefinition><unknown>albumSchemaDef)

@Didas-git Didas-git changed the title Removed logger and add helperr function Removed logger & Added mapSchema function Apr 22, 2022
@Didas-git Didas-git closed this Aug 31, 2022
@Didas-git Didas-git deleted the nested-objects branch August 31, 2022 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant