> For the complete documentation index, see [llms.txt](https://olee-tech.gitbook.io/django/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://olee-tech.gitbook.io/django/django-orm/advanced-querying-with-django-orm/f-expressions.md).

# F() Expressions

F() Expressions ডেটাবেজ থেকে ভ্যালু প্যারামিটার হিসাবে নিয়ে ডেটাবেজের সাথে বিভিন্ন অপারেশন করতে সাহায্য করে। মূলত আপডেট এবং ফিল্টার করার জন্য ব্যবহার করা হয়।

```python
from django.db import models

class Product(models.Model):
    name = models.CharField(max_length=100)
    price = models.DecimalField(max_digits=10, decimal_places=2)
    quantity = models.PositiveIntegerField()
    discounted_price = models.DecimalField(max_digits=10, decimal_places=2)

```

**আপডেট করার জন্য**&#x20;

সমস্ত price কে দুই দ্বারা গুন করলাম।

```python
from django.db.models import F

# Double the price of all products
Product.objects.update(price=F('price') * 2)
```

**ফিল্টার করার জন্য**&#x20;

```python
from django.db.models import F

# Retrieve products where the regular price is greater than the discounted price
products = Product.objects.filter(price__gt=F('discounted_price'))

```
