Welcome to the Tigris April 2023 update!
This month saw a preview of our Vector database search, a new Tigris Astro integration, the completion of our NoSQL data modeling guides, the invention of a new technology stack called TERN, and more.
This update covers:
- ๐ค Vector search preview
- ๐พ Tigris Astro integration
- ๐งโ๐ซ NoSQL data modeling series complete
- ๐งฐ From the MERN stack to TERN
- โจ Tigris TypeScript SDK filter syntax update (Breaking change!)
- ๐ Data import with schema inference for both JSON and CSV
- ๐ฆพ Web console updates
- ๐ค MongoDB vs DynamoDB vs Tigris
๐ค Vector search previewโ
Earlier this month, we previewed how to use our upcoming Vector Search feature in a blog post that demonstrates how to use Tigris Vector Search with OpenAI embeddings.
Stay tuned for much more on our Vector Search feature.
๐พ Tigris Astro integrationโ
Astro is a web framework with an exciting and growing ecosystem of integrations. But we were particularly pleased to be the first Astro database integration.
Here's a taster of what the Tigris Astro integration makes possible:
---
import { useTigrisCollection } from "@tigrisdata/astro";
class Comment {
id: string;
slug: string;
name: string;
message: string;
createdAt: Date;
}
const { slug } = Astro.props;
const commentCollection = await useTigrisCollection<Comment>("comments");
const postCommentsCursor = await commentCollection.findMany({
filter: { slug },
sort: [{ field: "createdAt", order: "$desc" }],
});
const comments = await postCommentsCursor.toArray();
---
{
comments.map((comment) => {
return (
<div class="comment" id={`comment${comment.id}`}>
<p>{comment.message}</p>
<h4>{comment.name}</h4>
<time>{new Date(comment.createdAt).toLocaleString()}</time>
</div>
);
})
}
You can also find the integration over on the official Astro integrations page.
๐งโ๐ซ NoSQL data modeling series completeโ
I often find myself heading to Garren's NoSQL data modeling series posts to be reminded how best to model the relationships between data when I'm building demos. Yes, the examples use Tigris, but the principles for one-to-one, one-to-many, and many-to-many NoSQL data modeling remains the same no matter what NoSQL database you're using. Make sure you bookmark these!
๐งฐ From the MERN stack to TERNโ
We introduced the TERN stack: an evolution of the MERN stack.
MERN is a popular technology stack utilizing MongoDB, Express.js, React, and Node.js. TERN is an evolution of MERN, swapping MongoDB for Tigris, enabling you to take advantage of a modern cloud-native NoSQL database and search platform.
You can read our introduction to TERN which includes steps on how to migrate from MERN to TERN.
You can also read our post covering getting started with TERN which introduces a new TERN GitHub template to enable you to quickly get up and running with a TERN stack app.
โจ Tigris TypeScript SDK filter syntax update (Breaking change!)โ
The Tigris TypeScript SDK filter syntax was simplified in v1.0.0-beta.46 to be much more intuitive and will save us a few characters too.
Prior to v1.0.0-beta.46 the filter syntax was as follows:
const productsCursor = catalog.findMany({
filter: {
op: LogicalOperator.OR,
selectorFilters: [
{
brand: "adidas",
},
{
op: SelectorFilterOperator.LT,
fields: {
price: 50,
},
},
],
},
});
I'm sure you'll agree that the following is much better:
const productsCursor = catalog.findMany({
filter: {
$or: [{ brand: "adidas" }, { price: { $lt: 50 } }],
},
});
Supported operators:
$eq
: equal to is used for exact matching.$lt
: less than is used for matching documents using less than criteria.$lte
: less than or equal to is similar to $lt but also matches for equality.$gt
: greater than is used for matching documents using greater than criteria.$gte
: greater than or equal to is similar to $gt but also matches for equality.$not
: not is used for matching documents using not equal criteria.$regex
: regex is used for matching documents using a regular expression.$contains
: contains is used for matching documents with fields containing the given substring.
For multiple conditions, there are two logical operators supported.
$or
: Combines multiple filter operators and returns documents when either condition is met.$and
: Combines multiple filter operators and returns documents when all the conditions are met.
Read the TypeScript query docs for full details.
๐ Data import with schema inference for both JSON and CSVโ
Changing database providers can be a big challenge, so we want to make it as simple as possible to bring your data over to us. We recently released new functionality in the Tigris CLI that enables you to import JSON and CSV data and the Tigris platform will automatically infer the database schema from the data you import.
Read the data importing docs for more information.
๐ฆพ Web console updatesโ
The Tigris web console allows you to manage your account and projects in Tigris Cloud. It comes with a suite of tools to improve your developer workflow and investigate the data you have stored in Tigris.
Create and edit database branchesโ
You can now create database branches, and define schema, browse data, and edit data within those branches within the Tigris web console.
MongoDB compatibility connection stringโ
You can now quickly access the MongoDB compatibility connection string to be used within your MongoDB applications.
Just head to Your project -> Get Started -> MongoDB Compatibility.
๐ค MongoDB vs DynamoDB vs Tigrisโ
Find out how Tigris compares as an alternative to MongoDB and DynamoDB. This article covers types of NoSQL databases, data models, scaling, data consistency, ACID transactions, secondary indexes, database branching, integrated search, automatic database sharding, and more.
๐ฐ Subscribe to the Tigris Newsletterโ
And that's a wrap!
Don't miss the next Tigris monthly update! Subscribe to the Tigris Newsletter.