# Migration Guide: 11.24.0 → 11.24.1

## Overview

| Category | Details |
|----------|---------|
| **Breaking Changes** | None |
| **New Features** | `pushToArray()`/`pullFromArray()` now accept `ObjectId` and objects with `id`/`_id` property |
| **Migration Effort** | 0 minutes (no code changes required) |

---

## Quick Migration

No code changes required.

```bash
# Update package
pnpm add @lenne.tech/nest-server@11.24.1

# Verify build
pnpm run build

# Run tests
pnpm test
```

---

## What's New in 11.24.1

### Flexible `id` Parameter on `pushToArray()` / `pullFromArray()`

Both methods now accept `string`, `Types.ObjectId`, or any object with an `id`/`_id` property (e.g. a Mongoose Document). IDs are normalized internally via `getStringIds()`, consistent with the rest of the framework.

**Before (11.24.0):** Only `string` was accepted.
```typescript
await this.entityService.pushToArray(entity.id, 'logs', newLog);
await this.entityService.pullFromArray(entity.id.toString(), 'tags', 'old');
```

**After (11.24.1):** All ID types work directly.
```typescript
// String (still works)
await this.entityService.pushToArray('507f1f77bcf86cd799439011', 'logs', newLog);

// ObjectId
await this.entityService.pushToArray(new Types.ObjectId(id), 'logs', newLog);

// Object with id property (e.g. Mongoose Document or entity reference)
await this.entityService.pushToArray(entity, 'logs', newLog);

// Same for pullFromArray
await this.entityService.pullFromArray(entity, 'tags', 'obsolete');
```

---

## Compatibility Notes

Existing code using `string` IDs continues to work unchanged. The wider type signature is additive — no existing call sites break.

---

## References

- [Migration Guide 11.23.x → 11.24.0](./11.23.x-to-11.24.0.md) — Full list of changes in 11.24.0
