![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@contentrain/query
Advanced tools
Query builder for Contentrain SDK.
npm install @contentrain/query @contentrain/core
import { ContentrainCore } from '@contentrain/core'
import { ContentrainQuery } from '@contentrain/query'
// Initialize core and query
const core = new ContentrainCore()
const query = new ContentrainQuery(core)
// Basic query
const posts = await query
.from('posts')
.where('status', 'publish')
.get()
// Complex query
const featuredPosts = await query
.from('posts')
.where('status', 'publish')
.where('featured', true)
.orderBy('createdAt', 'desc')
.limit(5)
.get()
// Query with relations
const postsWithAuthor = await query
.from('posts')
.with('author')
.where('status', 'publish')
.get()
// Query with multiple conditions
const searchPosts = await query
.from('posts')
.where([
['status', 'publish'],
['category', 'technology'],
['title', 'startsWith', 'How to']
])
.get()
constructor(core: ContentrainCore)
Creates a new instance of ContentrainQuery.
from(collection: string): ContentrainQuery
Specifies the collection to query.
where(field: string, value: any): ContentrainQuery
where(field: string, operator: FilterOperator, value: any): ContentrainQuery
where(conditions: [string, any][] | [string, FilterOperator, any][]): ContentrainQuery
Adds where conditions to the query.
orderBy(field: string, direction: 'asc' | 'desc' = 'asc'): ContentrainQuery
Orders the results by a field.
limit(count: number): ContentrainQuery
Limits the number of results.
offset(count: number): ContentrainQuery
Skips the specified number of results.
with(...relations: string[]): ContentrainQuery
Includes related content in the results.
get<T>(): Promise<T[]>
Executes the query and returns the results.
equals
(default)notEquals
contains
notContains
startsWith
endsWith
exists
notExists
gt
(greater than)gte
(greater than or equal)lt
(less than)lte
(less than or equal)MIT
FAQs
Core package for Contentrain SDK, providing fundamental functionality and types
The npm package @contentrain/query receives a total of 0 weekly downloads. As such, @contentrain/query popularity was classified as not popular.
We found that @contentrain/query demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.