This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Entity, Schema, Client, Repository } from 'redis-om' | |
class Album extends Entity {} | |
let schema = new Schema(Album, { | |
artist: { type: 'string' }, | |
title: { type: 'string' }, | |
year: { type: 'number' }, | |
genres: { type: 'array' }, | |
outOfPublication: { type: 'boolean' } | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Entity, Schema, Client, Repository } from 'redis-om' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Album extends Entity {} | |
let schema = new Schema(Album, { | |
artist: { type: 'string' }, | |
title: { type: 'string', textSearch: true }, | |
year: { type: 'number' } | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Redis from 'ioredis' | |
const redis = new Redis() | |
async function main() { | |
await redis.flushall() | |
console.time('total') | |
console.log() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Redis from 'ioredis' | |
import * as ioredisearch from './ioredisearch' | |
let r = new Redis() | |
ioredisearch.use(r) | |
let results = yield r.list() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aioredis | |
from pprint import pp | |
async def main(): | |
redis = await aioredis.create_redis('redis://:foobared@localhost:6379/0', encoding='utf-8') | |
await asyncio.gather( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aioredis | |
from pprint import pp | |
async def main(): | |
redis = await aioredis.create_redis('redis://:foobared@localhost:6379/0', encoding='utf-8') | |
await redis.execute('FT.DROP', 'bigfoot:sightings:search') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aioredis | |
from pprint import pp | |
async def main(): | |
redis = await aioredis.create_redis('redis://:foobared@localhost:6379/0', encoding='utf8') | |
last_id = '0-0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aioredis | |
async def main(): | |
redis = await aioredis.create_redis('redis://:foobared@localhost:6379/0', encoding='utf-8') | |
await asyncio.gather( | |
add_to_stream(redis, 1, 'Possible vocalizations east of Makanda', 'Class B'), | |
add_to_stream(redis, 2, 'Sighting near the Columbia River', 'Class A'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aioredis | |
from pprint import pp | |
async def main(): | |
redis = await aioredis.create_redis('redis://:foobared@localhost:6379/0', encoding='utf-8') | |
[channel] = await redis.psubscribe('bigfoot:broadcast:channel:*') |
NewerOlder