# Cannot reach your data. Search function no longer works

**URL:** https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934
**Category:** Help me!
**Created:** [March 2, 2025, 10:10pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934 "2025-03-02T22:10:05Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 2, 2025, 10:10pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/1 "2025-03-02T22:10:05Z")

</div>

Hi team,  
I encounter difficulties on two customer and drivers collections. The search function no longer works and I have this error. See capture and configuration.

_# Cannot reach your data_  
_Your server may be down or your database connection broken._  
_Please check your server logs for more information._

 ![Capture d’écran 2025-03-02 à 23.02.46](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/fdd4f78ff308e4fc286aa17b286323e204756a3f.png)

“forest-express-mongoose”: “^9.5.6”,

“meta”: {  
“database\_type”: “MongoDB”,  
“liana”: “forest-express-mongoose”,  
“liana\_version”: “6.7.2”,  
“engine”: “nodejs”,  
“engine\_version”: “10.22.1”,  
“orm\_version”: “5.11.13”  
}  
}

mongoDB 6.0

I want to specify that the search works on other collections. I think there is an evolution to be applied in the NODE code.JS 14.18. Can you help me please

---

<div class="post-metadata">

### Author: ![anon7311026](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@anon7311026](https://community.forestadmin.com/u/anon7311026)
#### Post date: [March 3, 2025, 9:55am UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/2 "2025-03-03T09:55:43Z")

</div>

Hello @Stephane_Evrard, welcome to the community 👋  
In order for us to better help you, could you please provide the following info:

- Project name: …
- Team name: …
- Environment name: …
- Type of project (cloud or self-hosted): …
- Agent technology: (nodejs, php, rails, python)
- Agent (forest package) name & version: …
- Database type: …
- Recent changes made on your end if any: …

Thanks 🙏

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 4, 2025, 8:50am UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/3 "2025-03-04T08:50:48Z")

</div>

Hi Nicolas,  
project name roby  
admin  
prod  
cloud  
node  
“forest-express-mongoose”: “^9.5.6”,

“meta”: {  
“database\_type”: “MongoDB”,  
“liana”: “forest-express-mongoose”,  
“liana\_version”: “6.7.2”,  
“engine”: “nodejs”,  
“engine\_version”: “10.22.1”,  
“orm\_version”: “5.11.13”  
}  
}

mongoDB 6.0

no recente release no update less 6 months.

---

<div class="post-metadata">

### Author: ![anon7311026](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@anon7311026](https://community.forestadmin.com/u/anon7311026)
#### Post date: [March 4, 2025, 10:04am UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/4 "2025-03-04T10:04:20Z")

</div>

ok thanks for the details. I have found your project 🙏

Since this is a self-hosted project, can you provide the errors logs that are displayed on your agent server while trying to search the problematic collections ? You should be using a dev environment, as you it will have more log details

Thanks

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 4, 2025, 12:43pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/5 "2025-03-04T12:43:26Z")

</div>

HI Niclolas,  
Our logs give nothing, the problem is on your side. We have the same problem in all environements. We do not see when we launch the search with a name or a mobile or other we have directly this message. Have you carried out a migration recently?  
TKS  
My email [stephane@sas-aton.fr](mailto:stephane@sas-aton.fr)

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 4, 2025, 12:43pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/6 "2025-03-04T12:43:54Z")

</div>

Do you have a Channel Slack for clarify the situation ?  
I can test with you in live on UAT ENV.

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 4, 2025, 12:52pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/7 "2025-03-04T12:52:39Z")

</div>

When i check the collection of Drivers, work well.

```javascript
server-v5.0_1 | 2025-03-04T12:51:42.328Z - info: GET /v5.0/forest-admin/api/forest/drivers?timezone=Europe%2FParis&fields%5Bdrivers%5D=createdCountryFlag%2Cfullname%2CcreatedCity%2CdriverVehicleTypeEnum%2CdriverStatus%2CdriverTaxiNumber%2Cemail%2CdriverVehicleTypeIcon%2CphoneNumber%2CcreatedAt%2ClastLoginAt%2CisDriverAvailable%2CdriverProfileCompleted%2CsessionMode%2CisDriverLead%2CdriverShortId%2CturnOver&fields%5BturnOver%5D=_id&page%5Bnumber%5D=1&page%5Bsize%5D=30&sort=id 304 142ms
nginx_1 | 172.17.0.2 - - [04/Mar/2025:12:51:42 +0000] "GET /v5.0/forest-admin/api/forest/drivers?timezone=Europe%2FParis&fields%5Bdrivers%5D=createdCountryFlag%2Cfullname%2CcreatedCity%2CdriverVehicleTypeEnum%2CdriverStatus%2CdriverTaxiNumber%2Cemail%2CdriverVehicleTypeIcon%2CphoneNumber%2CcreatedAt%2ClastLoginAt%2CisDriverAvailable%2CdriverProfileCompleted%2CsessionMode%2CisDriverLead%2CdriverShortId%2CturnOver&fields%5BturnOver%5D=_id&page%5Bnumber%5D=1&page%5Bsize%5D=30&sort=id HTTP/1.1" 304 0 "https://app.forestadmin.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
mongo_1 | {"t":{"$date":"2025-03-04T12:51:44.004+00:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn2","msg":"Slow query","attr":{"type":"command","ns":"admin.$cmd","command":{"serverStatus":1,"repl":1,"metrics":{"document":true,"cursor":true,"queryExecutor":true,"apiVersions":false,"aggStageCounters":false,"commands":false,"dotsAndDollarsFields":false,"getLastError":false,"mongos":false,"operation":false,"operatorCounters":false,"query":false,"record":false,"repl":false,"storage":false,"ttl":false},"lsid":{"id":{"$uuid":"da2858cb-2a55-42b5-b829-8a5aa20855f1"}},"$db":"admin"},"numYields":0,"reslen":32617,"locks":{"FeatureCompatibilityVersion":{"acquireCount":{"r":3}},"Global":{"acquireCount":{"r":3}}},"storage":{},"protocol":"op_msg","durationMillis":3}}

```

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 4, 2025, 12:54pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/8 "2025-03-04T12:54:35Z")

</div>

this is the logs when a add search ::

```javascript
mongo_1 | {"t":{"$date":"2025-03-04T12:52:47.003+00:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn2","msg":"Slow query","attr":{"type":"command","ns":"admin.$cmd","command":{"serverStatus":1,"repl":1,"metrics":{"document":true,"cursor":true,"queryExecutor":true,"apiVersions":false,"aggStageCounters":false,"commands":false,"dotsAndDollarsFields":false,"getLastError":false,"mongos":false,"operation":false,"operatorCounters":false,"query":false,"record":false,"repl":false,"storage":false,"ttl":false},"lsid":{"id":{"$uuid":"da2858cb-2a55-42b5-b829-8a5aa20855f1"}},"$db":"admin"},"numYields":0,"reslen":32617,"locks":{"FeatureCompatibilityVersion":{"acquireCount":{"r":3}},"Global":{"acquireCount":{"r":3}}},"storage":{},"protocol":"op_msg","durationMillis":2}}
server-v5.0_1 | MongoError: invalid flag in regex options: g
server-v5.0_1 | at MessageStream.messageHandler (/usr/src/app/node_modules/mongodb/lib/cmap/connection.js:299:20)
server-v5.0_1 | at MessageStream.emit (events.js:400:28)
server-v5.0_1 | at MessageStream.emit (domain.js:475:12)
server-v5.0_1 | at processIncomingData (/usr/src/app/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
server-v5.0_1 | at MessageStream._write (/usr/src/app/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
server-v5.0_1 | at writeOrBuffer (internal/streams/writable.js:358:12)
server-v5.0_1 | at MessageStream.Writable.write (internal/streams/writable.js:303:10)
server-v5.0_1 | at TLSSocket.ondata (internal/streams/readable.js:731:22)
server-v5.0_1 | at TLSSocket.emit (events.js:400:28)
server-v5.0_1 | at TLSSocket.emit (domain.js:475:12)
server-v5.0_1 | at addChunk (internal/streams/readable.js:293:12)
server-v5.0_1 | at readableAddChunk (internal/streams/readable.js:267:9)
nginx_1 | 172.17.0.2 - - [04/Mar/2025:12:52:51 +0000] "GET /v5.0/forest-admin/api/forest/drivers?timezone=Europe%2FParis&fields%5Bdrivers%5D=createdCountryFlag%2Cfullname%2CcreatedCity%2CdriverVehicleTypeEnum%2CdriverStatus%2CdriverTaxiNumber%2Cemail%2CdriverVehicleTypeIcon%2CphoneNumber%2CcreatedAt%2ClastLoginAt%2CisDriverAvailable%2CdriverProfileCompleted%2CsessionMode%2CisDriverLead%2CdriverShortId%2CturnOver&fields%5BturnOver%5D=_id&isSearchExtended=false&page%5Bnumber%5D=1&page%5Bsize%5D=30&search=thomas&searchExtended=0&sort=id HTTP/1.1" 500 507 "https://app.forestadmin.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
server-v5.0_1 | at TLSSocket.Readable.push (internal/streams/readable.js:206:10)
server-v5.0_1 | at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)
server-v5.0_1 | at TLSWrap.callbackTrampoline (internal/async_hooks.js:130:17)
server-v5.0_1 | 2025-03-04T12:52:51.567Z - info: GET /v5.0/forest-admin/api/forest/drivers?timezone=Europe%2FParis&fields%5Bdrivers%5D=createdCountryFlag%2Cfullname%2CcreatedCity%2CdriverVehicleTypeEnum%2CdriverStatus%2CdriverTaxiNumber%2Cemail%2CdriverVehicleTypeIcon%2CphoneNumber%2CcreatedAt%2ClastLoginAt%2CisDriverAvailable%2CdriverProfileCompleted%2CsessionMode%2CisDriverLead%2CdriverShortId%2CturnOver&fields%5BturnOver%5D=_id&isSearchExtended=false&page%5Bnumber%5D=1&page%5Bsize%5D=30&search=thomas&searchExtended=0&sort=id 500 35ms
mongo_1 | {"t":{"$date":"2025-03-04T12:52:54.002+00:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn2","msg":"Slow query","attr":{"type":"command","ns":"admin.$cmd","command":{"serverStatus":1,"repl":1,"metrics":{"document":true,"cursor":true,"queryExecutor":true,"apiVersions":false,"aggStageCounters":false,"commands":false,"dotsAndDollarsFields":false,"getLastError":false,"mongos":false,"operation":false,"operatorCounters":false,"query":false,"record":false,"repl":false,"storage":false,"ttl":false},"lsid":{"id":{"$uuid":"da2858cb-2a55-42b5-b829-8a5aa20855f1"}},"$db":"admin"},"numYields":0,"reslen":32617,"locks":{"FeatureCompatibilityVersion":{"acquireCount":{"r":3}},"Global":{"acquireCount":{"r":3}}},"storage":{},"protocol":"op_msg","durationMillis":1}}
mongo_1 | {"t":{"$date":"2025-03-04T12:52:58.003+00:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn2","msg":"Slow query","attr":{"type":"command","ns":"admin.$cmd","command":{"serverStatus":1,"repl":1,"metrics":{"document":true,"cursor":true,"queryExecutor":true,"apiVersions":false,"aggStageCounters":false,"commands":false,"dotsAndDollarsFields":false,"getLastError":false,"mongos":false,"operation":false,"operatorCounters":false,"query":false,"record":false,"repl":false,"storage":false,"ttl":false},"lsid":{"id":{"$uuid":"da2858cb-2a55-42b5-b829-8a5aa20855f1"}},"$db":"admin"},"numYields":0,"reslen":32617,"locks":{"FeatureCompatibilityVersion":{"acquireCount":{"r":3}},"Global":{"acquireCount":{"r":3}}},"storage":{},"protocol":"op_msg","durationMillis":1}}
m
```

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 4, 2025, 12:56pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/9 "2025-03-04T12:56:26Z")

</div>

The problem therefore comes from an incompatibility between the way in which Forest Admin (via Forest - Express - Mongoose) builds research requests and Mongodb expectations concerning the options of regular expressions. A correction requires the modification of the request so that it does not include the flag g. Do not hesitate to consult the documentation or the support of Forest Admin to see if other users have encountered the same problem and what solutions have been implemented.

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 4, 2025, 5:14pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/10 "2025-03-04T17:14:05Z")

</div>

Hello Forest Admin Support Team,

We are experiencing a critical issue with the search functionality in Forest Admin when using MongoDB (v5.0 and above, including 6.0). When a search is performed, the regex expression generated by forest‑express‑mongoose automatically includes the **g** (global) flag, which MongoDB no longer supports starting with version 5.0. As a result, our logs show the following error:

makefile

Copy

```javascript
MongoError: invalid flag in regex options: g

```

**Context:**

- **Stack in use:**
  - **Forest Admin** via **forest‑express‑mongoose** (version 9.5.6 with liana 6.7.2)
  - **Node.js** : using node:14-bullseye (ensuring Node 14.18.0+ compatibility)
  - **MongoDB** : version 6.0 (and above)

---

<div class="post-metadata">

### Author: ![anon7311026](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@anon7311026](https://community.forestadmin.com/u/anon7311026)
#### Post date: [March 5, 2025, 10:45am UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/11 "2025-03-05T10:45:49Z")

</div>

Thanks for all those details,

you mentionned

> no recente release no update less 6 months.

But I understand that you have recently upgraded your `mongodb` version to 5.0 or above, which started triggering the issue, is that the case ?  
You are expecting `forest-express-mongoose` to be compatible with mongodb versions 5.0 and up, is that correct ?

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 5, 2025, 5:17pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/12 "2025-03-05T17:17:25Z")

</div>

Hello, Mongodb forced the update in Mongo 6.  
It is not our will.  
Do you have you planned for a fix about : Invalid Flag in Regex Options: G ?  
We can’t used some research and action on Forest.  
Tks

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 5, 2025, 5:22pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/13 "2025-03-05T17:22:54Z")

</div>

I tried to come back to version 4 of Mongo on UAT and it does not work.

**I really think it is linked to an update on your side which prevents us now from using the platform.**

We do not have a way to act on communication between Mongoose and Forest-Admin.

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 5, 2025, 5:25pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/14 "2025-03-05T17:25:22Z")

</div>

> **[Regex flag /g not supported in aggregation on Serverless cluster?](https://www.mongodb.com/community/forums/t/regex-flag-g-not-supported-in-aggregation-on-serverless-cluster/162363)**
>
> Trying this $match stage on a normal Atlas cluster { "SomeField": { $regex: 't', $options: 'g' } } works fine and returns the matched documents. Trying the same thing on a serverless cluster returns this error: Command aggregate failed:...

 ![Capture d’écran 2025-03-05 à 18.25.15](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/f5561007ca5c72608972b3569e2982884a937a8a.png)

---

<div class="post-metadata">

### Author: ![Stephane\_Evrard](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/stephane_evrard/32/441_2.png) [@Stephane\_Evrard](https://community.forestadmin.com/u/Stephane_Evrard)
#### Post date: [March 5, 2025, 5:37pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/15 "2025-03-05T17:37:00Z")

</div>

Dear all,  
I fix it on our side, we publish the update without option ‘g’

let regexFullCond = {  
$regex: `^${escapeStringRegexp(_search)}$`,  
$options: “i”

---

<div class="post-metadata">

### Author: ![anon7311026](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@anon7311026](https://community.forestadmin.com/u/anon7311026)
#### Post date: [March 6, 2025, 8:49am UTC](https://community.forestadmin.com/t/cannot-reach-your-data-search-function-no-longer-works/7934/16 "2025-03-06T08:49:20Z")

</div>

Hello @Stephane_Evrard,  
I’m glad that you have found a workaround. thanks for marking the thread as sovled.  
I will see if we can fix it on the `forest-express-mongoose` as well.
