Skip to content

Files Model

Overview

  • Collection: file
  • Labels: File, Files

Fields

FieldTypeOperationsDefaultDescription
_idObjectIdRead, Update, Delete-Unique identifier
user_idObjectIdCreate, Read, Update-Reference to user
nameStringCreate, Read, Update-Display name
descriptionStringCreate, Read, Update-Detailed description
filenameStringCreate, Read--
providerStringCreate, Read, Update--
bucketStringCreate, Read, Update--
keyStringCreate, Read, Update--
urlStringCreate, Read, Update-URL or link
uploaded_atDateCreate, Read, Update--
file_modified_atDateCreate, Read, Update--
hashStringCreate, Read, Update-Content hash
sizeNumberCreate, Read, Update-Size in bytes
content_typeStringCreate, Read, Update--
extensionStringCreate, Read, Update--
parent_fileObjectIdCreate, Read, Update--
typeStringRead, Update-Type classification
flattened_atDateCreate, Read, Update--
flattened_pagesObject(ObjectId)Create, Read, Update--

Operations

Create

javascript
const result = await API.DB.file.create({ values: { /* ... */ } });

Read

javascript
const item = await API.DB.file.read({ where: { _id: 'id' } });

Read All

javascript
const items = await API.DB.file.readAll({ where: { /* ... */ } });

Update

javascript
const result = await API.DB.file.update({ 
  where: { _id: 'id' }, 
  values: { /* ... */ } 
});

Delete

javascript
const result = await API.DB.file.delete({ where: { _id: 'id' } });

Filters

No filters defined for this model.

Examples

Creating a Files

javascript
const newFiles = await API.DB.Files.create({
  values: {
    // Add your field values here
  }
});

Finding Files

javascript
const files = await API.DB.Files.readAll({
  where: {
    // Add your query conditions
  }
});

Generated on 2025-05-28T14:54:24.679Z

Released under the MIT License.