Forum Discussion

CarlaA's avatar
CarlaA
Mentor
2 months ago

Non Spam Posts for a given time frame

I'm trying to retrieve the number of non-spam posts within a specific timeframe from my database. What should the query be in this case? 

2 Replies

  • CarlaAYou can fetch the messages that are not marked as SPAM by including the following condition in your query: moderation_status: "approved".

    For ex: select count(*) from messages where moderation_status="approved" and post_time>=2025-01-01T00:00:00.000-00:00 and post_time <= 2025-02-26T23:59:59.999-00:00

  • Hi HariniVuppala thank you! Will this query bring back the correct results regardless of whether or not we have pre-moderation off or on?