Skip to content

Commit 100f3a0

Browse files
Copilothotlong
andcommitted
refactor: fix remaining _id→id in tests, mocks, and documentation
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 8cbea94 commit 100f3a0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

content/docs/protocol/objectql/schema.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ Every object automatically includes system fields:
303303

304304
```yaml
305305
# Auto-generated (not defined in .object.yml)
306-
_id:
306+
id:
307307
type: id
308308
label: Record ID
309309
read_only: true
@@ -637,7 +637,7 @@ parent_id:
637637
Query polymorphic fields:
638638
```typescript
639639
const activity = await ObjectQL.findOne('activity', id);
640-
// activity.parent_id = { _id: '123', _type: 'account' }
640+
// activity.parent_id = { id: '123', _type: 'account' }
641641
```
642642

643643
### Computed Fields (Virtual)

content/docs/protocol/objectql/security.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ const user = await ObjectQL.findOne('user', '123');
256256

257257
// Result (salary/ssn stripped):
258258
// {
259-
// _id: '123',
259+
// id: '123',
260260
// name: 'John Doe',
261261
// email: 'john@example.com'
262262
// // salary: REMOVED
@@ -268,7 +268,7 @@ const user = await ObjectQL.findOne('user', '123');
268268

269269
// Result (salary visible):
270270
// {
271-
// _id: '123',
271+
// id: '123',
272272
// name: 'John Doe',
273273
// email: 'john@example.com',
274274
// salary: { amount: 120000, currency: 'USD' }

content/docs/protocol/objectql/types.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,12 +628,12 @@ const activity = await ObjectQL.findOne('activity', id, {
628628
expand: ['parent'] // Resolves based on _type
629629
});
630630
631-
// activity.parent = { _id: '123', _type: 'account', company_name: 'Acme' }
631+
// activity.parent = { id: '123', _type: 'account', company_name: 'Acme' }
632632
```
633633

634634
**Database mapping:**
635635
- PostgreSQL: Two columns `parent_id` + `parent_type`
636-
- MongoDB: `{ _id: String, _type: String }`
636+
- MongoDB: `{ id: String, _type: String }`
637637

638638
**Use cases:**
639639
- Activity feeds (related to Account OR Contact)

0 commit comments

Comments
 (0)