> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: queryPosts(options: QueryPostsOptions)

# Method package: wixBlogBackend

# Method menu location: wixBlogBackend --> posts --> queryPosts

# Method Link: https://dev.wix.com/docs/velo/apis/wix-blog-backend/posts/query-posts.md

# Method Description:

Creates a query to retrieve a list of posts. 


The `queryPosts()` function builds a query to retrieve a list of up to 100 posts, and returns a [`PostsQueryBuilder`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsquerybuilder) object. 

The returned object contains the query definition which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsquerybuilder/find) function.

You can refine the query by chaining `PostsQueryBuilder` functions onto the query. `PostsQueryBuilder` functions enable you to sort, filter, and control the results that `queryPosts()` returns.

`queryPosts()` runs with these `PostsQueryBuilder` defaults that can be overridden:
+ [`limit(50)`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsquerybuilder/limit)
+ [`descending('firstPublishedDate')`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsquerybuilder/descending)

Note that the default limit is `'50'`, but the max limit is `'100'`. 

To learn how to query posts, refer to the table below.

The following `PostsQueryBuilder` functions are supported for the `queryPosts()` function. For a full description of the Posts object, see the object returned for the [`items`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsqueryresult/items) property in [`PostsQueryResult`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsqueryresult).


|PROPERTY	|SUPPORTED FILTERS & SORTING	
|:---:|:---:|
|`_id`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`hasSome()`](/posts-query-builder/has-some),[`in()`](/posts-query-builder/in),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|
|`title`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`startsWith()`](/posts-query-builder/starts-with),[`hasSome()`](/posts-query-builder/has-some),[`exists()`](/posts-query-builder/exists),[`in()`](/posts-query-builder/in),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|
|`firstPublishedDate`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`lt()`](/posts-query-builder/lt),[`le()`](/posts-query-builder/le),[`gt()`](/posts-query-builder/gt),[`ge()`](/posts-query-builder/ge),[`in()`](/posts-query-builder/in),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|
|`lastPublishedDate`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`lt()`](/posts-query-builder/lt),[`le()`](/posts-query-builder/le),[`gt()`](/posts-query-builder/gt),[`ge()`](/posts-query-builder/ge),[`in()`](/posts-query-builder/in),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|
|`slug`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`hasSome()`](/posts-query-builder/has-some),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|
|`featured`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|
|`pinned`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|
|`categoryIds`|[`hasSome()`](/posts-query-builder/has-some),[`hasAll()`](/posts-query-builder/has-all)|
|`coverMedia.enabled`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne)|
|`memberId`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`hasSome()`](/posts-query-builder/has-some)|
|`hashtags`|[`hasSome()`](/posts-query-builder/has-some),[`hasAll()`](/posts-query-builder/has-all)|
|`commentingEnabled`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|
|`minutesToRead`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`lt()`](/posts-query-builder/lt),[`le()`](/posts-query-builder/le),[`gt()`](/posts-query-builder/gt),[`ge()`](/posts-query-builder/ge),[`in()`](/posts-query-builder/in)|
|`tagIds`|[`hasSome()`](/posts-query-builder/has-some),[`hasAll()`](/posts-query-builder/has-all)|
|`pricingPlanIds`|[`hasSome()`](/posts-query-builder/has-some),[`hasAll()`](/posts-query-builder/has-all)|
|`translationId`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`exists()`](/posts-query-builder/exists),[`in()`](/posts-query-builder/in)|
|`language`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`hasSome()`](/posts-query-builder/has-some),[`exists()`](/posts-query-builder/exists),[`in()`](/posts-query-builder/in)|
|`metrics.comments`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`lt()`](/posts-query-builder/lt),[`le()`](/posts-query-builder/le),[`gt()`](/posts-query-builder/gt),[`ge()`](/posts-query-builder/ge),[`in()`](/posts-query-builder/in),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|
|`metrics.likes`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`lt()`](/posts-query-builder/lt),[`le()`](/posts-query-builder/le),[`gt()`](/posts-query-builder/gt),[`ge()`](/posts-query-builder/ge),[`in()`](/posts-query-builder/in),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|
|`metrics.views`|[`eq()`](/posts-query-builder/eq),[`ne()`](/posts-query-builder/ne),[`lt()`](/posts-query-builder/lt),[`le()`](/posts-query-builder/le),[`gt()`](/posts-query-builder/gt),[`ge()`](/posts-query-builder/ge),[`in()`](/posts-query-builder/in),[`ascending()`](/posts-query-builder/ascending),[`descending()`](/posts-query-builder/descending)|



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Retrieve a list of all posts

```javascript
import { posts } from 'wix-blog-backend';

export async function queryPostsFunction() {
  try {
    const results = await posts.queryPosts().find();
    const items = results.items;
    const firstItem = items[0];
    const pageSize = results.pageSize;
    const hasNext = results.hasNext();
    const hasPrev = results.hasPrev();
    const length = results.length;
    const query = results.query;
    return items;
  } catch (error) {
    console.error(error);
  }
}

/* Returns:
 * [
 *   {
 *     "_id": "0a265609-e16e-4c96-b71a-2a62b513e6b8",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "some text",
 *     "featured": false,
 *     "firstPublishedDate": "2022-05-25T13:56:19.023Z",
 *     "hashtags": [],
 *     "language": "en",
 *     "lastPublishedDate": "2022-05-25T13:56:19.023Z",
 *     "media": {
 *       "wixMedia": {},
 *       "displayed": false,
 *       "custom": false
 *     },
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "minutesToRead": 1,
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "_new-post",
 *     "tagIds": [],
 *     "title": "new post",
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "ec9d2c31-4dd8-4993-80d7-fbf8c3148492",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "",
 *     "featured": false,
 *     "firstPublishedDate": "2022-04-27T07:10:09.020Z",
 *     "hashtags": [],
 *     "language": "en",
 *     "lastPublishedDate": "2022-04-27T07:10:09.020Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/11062b_049e75ff426d48d1a794debb05897c8c~mv2_d_4505_3003_s_4_2.jpg#originWidth=4505&originHeight=3003",
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "117f476b-be6e-4849-83c0-908f5e0725e7",
 *     "minutesToRead": 0,
 *     "pinned": false,
 *     "preview": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "post-with-cover-image",
 *     "tagIds": [],
 *     "title": "post with cover image",
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "6abf332c-353e-4074-8326-3c6350126bd4",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "demo content",
 *     "featured": false,
 *     "firstPublishedDate": "2022-04-22T08:04:17.108Z",
 *     "hashtags": [],
 *     "language": "en",
 *     "lastPublishedDate": "2022-04-22T08:04:17.108Z",
 *     "media": {
 *       "wixMedia": {},
 *       "displayed": false,
 *       "custom": false
 *     },
 *     "memberId": "62607f07-dbb4-4022-bbfd-283f8422a072",
 *     "minutesToRead": 1,
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "another-impersonated-post",
 *     "tagIds": [] ,
 *     "title": "another impersonated post",
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "2ad331d7-1308-4afd-b994-0768611b38df",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "demo content",
 *     "firstPublishedDate": "2022-04-12T12:19:56.907Z",
 *     "featured": false,
 *     "hashtags": [],
 *     "language": "en",
 *     "lastPublishedDate": "2022-04-12T12:19:56.907Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_9f8cd2f1282c4dc7ae9a4bea155e2661~mv2.jpg#originWidth=602&originHeight=773"
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "117f476b-be6e-4849-83c0-908f5e0725e7",
 *     "minutesToRead": 1,
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "demo-post",
 *     "tagIds": [],
 *     "title": "demo post",
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "67bee986-3a54-4f08-bb37-a59152f31b75",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "Create a blog post subtitle that summarizes your post in a few short, punchy sentences and entices your audience to continue reading....",
 *     "featured": false,
 *     "firstPublishedDate": "2022-03-09T13:15:14.566Z",
 *     "hashtags": [
 *       "vacation",
 *       "dream",
 *       "summer",
 *       "hashtag"
 *     ],
 *     "language": "en",
 *     "lastPublishedDate": "2022-05-03T10:26:13.781Z",
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_cf2c39f511b6478eaea5b4f7713831c0~mv2.jpg#originWidth=1944&originHeight=1409",
 *       },
 *       "displayed": false,
 *       "custom": false
 *     },
 *     "minutesToRead": 2,
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "transform-your-winter-blues-into-winter-creativity",
 *     "tagIds": [],
 *     "title": "Transform your winter blues into winter creativity",
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "dd0907fa-ca4b-4fe4-ab9e-625e4733691e",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "Create a blog post subtitle that summarizes your post in a few short, punchy sentences and entices your audience to continue reading....",
 *     "featured": false,
 *     "firstPublishedDate": "2022-03-09T13:15:14.565Z",
 *     "hashtags": [
 *       "vacation",
 *       "dream",
 *       "summer",
 *       "hashtag"
 *     ],
 *     "language": "en",
 *     "lastPublishedDate": "2022-05-03T10:26:35.834Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_19d50c96541b4b1aa915d498b351bd17~mv2.jpg#originWidth=886&originHeight=1161",
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "minutesToRead": 2,
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "5-reasons-to-wake-up-at-5am",
 *     "title": "5 reasons to wake up at 5am",
 *     "tagIds": [],
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "6a7c0e49-036b-4874-b4cd-e015a22e857c",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "Create a blog post subtitle that summarizes your post in a few short, punchy sentences and entices your audience to continue reading....",
 *     "featured": false,
 *     "firstPublishedDate": "2022-03-09T13:15:14.564Z",
 *     "hashtags": [
 *       "vacation",
 *       "dream",
 *       "summer",
 *       "hashtag"
 *     ],
 *     "language": "en",
 *     "lastPublishedDate": "2022-05-03T10:26:57.855Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_9f8cd2f1282c4dc7ae9a4bea155e2661~mv2.jpg#originWidth=602&originHeight=773"
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "minutesToRead": 2,
 *     "relatedPostIds": [],
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "slug": "how-decluttering-changed-my-life",
 *     "tagIds": [],
 *     "title": "How decluttering changed my life",
 *     "translationId": ""
 *   }
 * ]
 */

```

## Retrieve a list of all posts (export from backend code)

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import { posts } from 'wix-blog-backend';

export const queryPostsFunction = webMethod(Permissions.Anyone, async () => {
  try {
    const results = await posts.queryPosts().find();
    const items = results.items;
    const firstItem = items[0];
    const pageSize = results.pageSize;
    const hasNext = results.hasNext();
    const hasPrev = results.hasPrev();
    const length = results.length;
    const query = results.query;
    return items;
  } catch (error) {
    console.error(error);
  }
});

/* Returns:
 * [
 *   {
 *     "_id": "0a265609-e16e-4c96-b71a-2a62b513e6b8",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "some text",
 *     "featured": false,
 *     "firstPublishedDate": "2022-05-25T13:56:19.023Z",
 *     "hashtags": [],
 *     "language": "en",
 *     "lastPublishedDate": "2022-05-25T13:56:19.023Z",
 *     "media": {
 *       "wixMedia": {},
 *       "displayed": false,
 *       "custom": false
 *     },
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "minutesToRead": 1,
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "_new-post",
 *     "tagIds": [],
 *     "title": "new post",
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "ec9d2c31-4dd8-4993-80d7-fbf8c3148492",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "",
 *     "featured": false,
 *     "firstPublishedDate": "2022-04-27T07:10:09.020Z",
 *     "hashtags": [],
 *     "language": "en",
 *     "lastPublishedDate": "2022-04-27T07:10:09.020Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/11062b_049e75ff426d48d1a794debb05897c8c~mv2_d_4505_3003_s_4_2.jpg#originWidth=4505&originHeight=3003",
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "117f476b-be6e-4849-83c0-908f5e0725e7",
 *     "minutesToRead": 0,
 *     "pinned": false,
 *     "preview": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "post-with-cover-image",
 *     "tagIds": [],
 *     "title": "post with cover image",
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "6abf332c-353e-4074-8326-3c6350126bd4",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "demo content",
 *     "featured": false,
 *     "firstPublishedDate": "2022-04-22T08:04:17.108Z",
 *     "hashtags": [],
 *     "language": "en",
 *     "lastPublishedDate": "2022-04-22T08:04:17.108Z",
 *     "media": {
 *       "wixMedia": {},
 *       "displayed": false,
 *       "custom": false
 *     },
 *     "memberId": "62607f07-dbb4-4022-bbfd-283f8422a072",
 *     "minutesToRead": 1,
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "another-impersonated-post",
 *     "tagIds": [] ,
 *     "title": "another impersonated post",
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "2ad331d7-1308-4afd-b994-0768611b38df",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "demo content",
 *     "firstPublishedDate": "2022-04-12T12:19:56.907Z",
 *     "featured": false,
 *     "hashtags": [],
 *     "language": "en",
 *     "lastPublishedDate": "2022-04-12T12:19:56.907Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_9f8cd2f1282c4dc7ae9a4bea155e2661~mv2.jpg#originWidth=602&originHeight=773"
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "117f476b-be6e-4849-83c0-908f5e0725e7",
 *     "minutesToRead": 1,
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "demo-post",
 *     "tagIds": [],
 *     "title": "demo post",
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "67bee986-3a54-4f08-bb37-a59152f31b75",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "Create a blog post subtitle that summarizes your post in a few short, punchy sentences and entices your audience to continue reading....",
 *     "featured": false,
 *     "firstPublishedDate": "2022-03-09T13:15:14.566Z",
 *     "hashtags": [
 *       "vacation",
 *       "dream",
 *       "summer",
 *       "hashtag"
 *     ],
 *     "language": "en",
 *     "lastPublishedDate": "2022-05-03T10:26:13.781Z",
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_cf2c39f511b6478eaea5b4f7713831c0~mv2.jpg#originWidth=1944&originHeight=1409",
 *       },
 *       "displayed": false,
 *       "custom": false
 *     },
 *     "minutesToRead": 2,
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "transform-your-winter-blues-into-winter-creativity",
 *     "tagIds": [],
 *     "title": "Transform your winter blues into winter creativity",
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "dd0907fa-ca4b-4fe4-ab9e-625e4733691e",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "Create a blog post subtitle that summarizes your post in a few short, punchy sentences and entices your audience to continue reading....",
 *     "featured": false,
 *     "firstPublishedDate": "2022-03-09T13:15:14.565Z",
 *     "hashtags": [
 *       "vacation",
 *       "dream",
 *       "summer",
 *       "hashtag"
 *     ],
 *     "language": "en",
 *     "lastPublishedDate": "2022-05-03T10:26:35.834Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_19d50c96541b4b1aa915d498b351bd17~mv2.jpg#originWidth=886&originHeight=1161",
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "minutesToRead": 2,
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "5-reasons-to-wake-up-at-5am",
 *     "title": "5 reasons to wake up at 5am",
 *     "tagIds": [],
 *     "translationId": ""
 *   },
 *   {
 *     "_id": "6a7c0e49-036b-4874-b4cd-e015a22e857c",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "Create a blog post subtitle that summarizes your post in a few short, punchy sentences and entices your audience to continue reading....",
 *     "featured": false,
 *     "firstPublishedDate": "2022-03-09T13:15:14.564Z",
 *     "hashtags": [
 *       "vacation",
 *       "dream",
 *       "summer",
 *       "hashtag"
 *     ],
 *     "language": "en",
 *     "lastPublishedDate": "2022-05-03T10:26:57.855Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_9f8cd2f1282c4dc7ae9a4bea155e2661~mv2.jpg#originWidth=602&originHeight=773"
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "minutesToRead": 2,
 *     "relatedPostIds": [],
 *     "pinned": false,
 *     "pricingPlanIds": [],
 *     "slug": "how-decluttering-changed-my-life",
 *     "tagIds": [],
 *     "title": "How decluttering changed my life",
 *     "translationId": ""
 *   }
 * ]
 */
```

## Query for posts with filters 

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import { posts } from 'wix-blog-backend';

/* Sample options values:
 * {
 *   fieldsets: [
 *     'URL'
 *   ]
 * }
 */

export const myQueryPostsFunction = webMethod(Permissions.Anyone, async () => {
  try {
    const result = await posts.queryPosts()
      .hasSome('hashtags', ['sun','dream'])
      .gt('metrics.views', 1)
      .find();
    console.log('Retrieved Result', result.items);
    return result.items;
  } catch (error) {
    console.log(error);
  }
});


/* Returns:
 * [
 *   {
 *     "_id": "425a5dca-c32d-40e6-b2d7-a8ffa3addded",
 *     "categoryIds": [
 *       "1ea22fce-bc3c-4b78-9422-f0f367f8628e"
 *     ],
 *     "commentingEnabled": true,
 *     "excerpt": "Create a blog post subtitle that summarizes your post in a few short, punchy sentences and entices your audience to continue reading....",
 *     "title": "When expecting, expect the unexpected",
 *     "featured": false,
 *     "firstPublishedDate": "2022-03-09T13:18:14.562Z",
 *     "hashtags": [
 *       "vacation",
 *       "dream",
 *       "summer",
 *       "hashtag"
 *     ],
 *     "heroImage": "",
 *     "language": "en",
 *     "lastPublishedDate": "2022-06-06T13:23:04.650Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_9f8cd2f1282c4dc7ae9a4bea155e2661~mv2.jpg#originWidth=602&originHeight=773"
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "minutesToRead": 2,
 *     "moderationDetails": {},
 *     "pinned": false,
 *     "preview": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "when-expecting-expect-the-unexpected",
 *     "tagIds": [],
 *     "translationId": "",
 *     "url": "http://https://tadasz7.wixsite.com/blog-velo-events/post/my-when-expecting-expect-the-unexpected"
 *   },
 *   {
 *     "_id": "67bee986-3a54-4f08-bb37-a59152f31b75",
 *     "categoryIds": [],
 *     "commentingEnabled": true,
 *     "excerpt": "Create a blog post subtitle that summarizes your post in a few short, punchy sentences and entices your audience to continue reading....",
 *     "title": "Transform your winter blues into winter creativity",
 *     "featured": false,
 *     "firstPublishedDate": "2022-03-09T13:15:14.566Z",
 *     "hashtags": [
 *       "vacation",
 *       "dream",
 *       "summer",
 *       "hashtag"
 *     ],
 *     "heroImage": "",
 *     "language": "en",
 *     "lastPublishedDate": "2022-05-03T10:26:13.781Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_cf2c39f511b6478eaea5b4f7713831c0~mv2.jpg#originWidth=1944&originHeight=1409",
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "minutesToRead": 2,
 *     "moderationDetails": {},
 *     "pinned": false,
 *     "preview": false,
 *     "pricingPlanIds": [],
 *     "relatedPostIds": [],
 *     "slug": "transform-your-winter-blues-into-winter-creativity",
 *     "tagIds": [],
 *     "translationId": "",
 *     "url": "http://https://tadasz7.wixsite.com/blog-velo-events/post/transform-your-winter-blues-into-winter-creativity"
 *   },
 *   {
 *     "_id": "ccbb6257-ed0e-4521-97df-8b5b207adb00",
 *     "categoryIds": [
 *       "1ea22fce-bc3c-4b78-9422-f0f367f8628e"
 *     ],
 *     "commentingEnabled": true,
 *     "excerpt": "Create a blog post subtitle that summarizes your post in a few short, punchy sentences and entices your audience to continue reading....",
 *     "title": "My vacation",
 *     "featured": true,
 *     "firstPublishedDate": "2020-08-05T21:00:00.000Z",
 *     "hashtags": [
 *       "sea",
 *       "sun"
 *     ],
 *     "heroImage": "",
 *     "language": "en",
 *     "lastPublishedDate": "2020-08-05T21:00:00.000Z",
 *     "media": {
 *       "wixMedia": {
 *         "image": "wix:image://v1/75059a_9f8cd2f1282c4dc7ae9a4bea155e2661~mv2.jpg#originWidth=602&originHeight=773"
 *       },
 *       "displayed": true,
 *       "custom": false
 *     },
 *     "memberId": "4b9f4b64-0792-481e-9289-b2550c1bb7ea",
 *     "minutesToRead": 1,
 *     "moderationDetails": {},
 *     "pinned": false,
 *     "preview": false,
 *     "pricingPlanIds": [
 *       "b6e94a0c-4d0f-435e-9602-0dd61d2aca37"
 *     ],
 *     "relatedPostIds": [
 *       "425a5dca-c32d-40e6-b2d7-a8ffa3addded"
 *     ],
 *     "slug": "my-vacation",
 *     "tagIds": [
 *       "b698f939-cab5-419b-9966-ba0fa3316de9"
 *     ],
 *     "translationId": "3cd710b7-c28d-4547-9b8a-3c1ec776064b",
 *     "url": "http://https://tadasz7.wixsite.com/blog-velo-events/post/my-vacation"
 *   }
 * ]
 */

```

---