3.1.7 • Published 5 months ago
@orama/switch v3.1.7
Orama Switch
Orama Switch allows you to run queries on Orama Cloud and OSS with a single interface.
Installation
npm i @orama/switch
Usage
You can use the same APIs to access either Orama Cloud or Orama OSS.
For instance, this is how you would interact with Orama Cloud:
import { Switch } from '@orama/switch'
import { OramaClient } from '@oramacloud/client'
const client = new OramaClient({
endpoint: '<Your Orama Cloud Endpoint>',
api_key: '<Your Orama Cloud API Key>',
})
const orama = new Switch(client)
const results = await orama.search({
term: 'noise cancelling headphones',
where: {
price: {
lte: 99.99
}
}
})
And this is Orama OSS:
import { Switch } from '@orama/switch'
import { create } from '@orama/orama'
const db = await create({
schema: {
productName: 'string',
price: 'number'
}
})
const orama = new Switch(client)
const results = await orama.search({
term: 'noise cancelling headphones',
where: {
price: {
lte: 99.99
}
}
})
License
3.1.3
8 months ago
3.0.4
11 months ago
3.1.2
8 months ago
3.0.3
11 months ago
3.1.1
8 months ago
3.0.2
11 months ago
3.1.0
8 months ago
3.1.7
5 months ago
3.0.8
8 months ago
3.1.6
6 months ago
3.0.7
8 months ago
3.1.5
7 months ago
3.0.6
9 months ago
3.1.4
7 months ago
3.0.5
9 months ago
3.0.1
1 year ago
3.0.0
1 year ago
3.0.0-rc-4
1 year ago
3.0.0-rc-1
1 year ago
3.0.0-rc-3
1 year ago
3.0.0-rc-2
1 year ago
2.1.1
1 year ago
2.1.0
1 year ago