#community-help

Deleting Documents by Filtering with Date String

TLDR Serezha asked about deleting documents by filtering on date strings. Gustavo provided an initial solution, which was later corrected by Jainil and confirmed by Jason.

Powered by Struct AI
heavy_plus_sign1
11
3mo
Solved
Join the chat
Jun 21, 2023 (3 months ago)
Serezha
Photo of md5-eb49c5c6c4760da05ee63114a05e6013
Serezha
02:51 PM
Hi guys is it possible to delete documents by filtering with date (string field) if it it contains for example 'May'
03:13
Gustavo
03:13 PM
Something like:
delete({ filter_by: 'date:=May' })
Serezha
Photo of md5-eb49c5c6c4760da05ee63114a05e6013
Serezha
03:15 PM
Will it also delete docs with string like 'May 12'
Gustavo
Photo of md5-f930fdb99fd46477205fa1201164ea50
Gustavo
03:27 PM
Hm, I think := works as strictly equal
03:28
Gustavo
03:28 PM
Let's wait for someone from the team
Jainil
Photo of md5-bea1e4531665b4608c47d00462429d3a
Jainil
03:58 PM
You can use { filter_by: 'date: May' }
Which can filter docs that are not strictly equal, but contain the inputted string as a word.
heavy_plus_sign1
Serezha
Photo of md5-eb49c5c6c4760da05ee63114a05e6013
Serezha
04:12 PM
Ok thanks 👍
04:12
Jainil
04:12 PM
you got it
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:34 PM
Confirming that := is indeed exact filtering. : is word-level contains filtering