# Record Details not displaying

**URL:** <https://community.forestadmin.com/t/record-details-not-displaying/4281>\
**Category:** Help me!\
**Tags:** setup, typescript\
**Created:** [March 1, 2022, 8:09pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281 "2022-03-01T20:09:43Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony\_Wentzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/anthony_wentzel/32/4141_2.png) [@Anthony\_Wentzel](https://community.forestadmin.com/u/Anthony_Wentzel)\
**Post date:** [March 1, 2022, 8:09pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/1 "2022-03-01T20:09:43Z")

</div>

> ⚠ **This is a template you must use to report issues**. ⚠  
> You can also drag images, videos and include `Preformatted text`.

List view showing correctly:

 ![Screen Shot 2022-03-01 at 12.07.31 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/b/b8625e6e8c9a628028426e81ee4f657ea8c8c6b4.png)

Error when selecting individual record:

 ![Screen Shot 2022-03-01 at 12.06.38 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/1/1dfc3a398956e3a27691a7035fc618dd362be964.png)

## Feature(s) impacted

> Please describe in this **mandatory section** the feature(s) that will be discussed in this topic.

The CRUD routes seem to all return 404 even though the list routes display details

## Observed behavior

> Please describe in this **mandatory section** the current behavior you observe.

When selecting an individual record, the api returns a 404 (Not Found).

## Expected behavior

> Please describe in this **mandatory section** the behavior you are expecting.

We’d assume the mongo record 62045768be659c3a4205f267 from collection “sources” would display

## Failure Logs

> In this _optional section_, please:
> 
> - include any relevant log snippets if necessary,
> - or remove this section if left empty.

## Context

> Please provide in this **mandatory section** , the relevant information about your configuration:

- Project name: Carrot Warehouse
- Team name: Operations
- Environment name: Development
- Agent type & version:

“forest-express-mongoose”: “8.6.3”,

- Recent changes made on your end if any:

Simply using the forest-express-mongoose:

```javascript
import * as Forest from 'forest-express-mongoose'
import * as Mongoose from 'mongoose'

console.log('connection.modelNames', connection.modelNames())
  connection.modelNames().map((modelName) => {
    Forest.collection(modelName, {
      actions: [],
      fields: [],
      segments: [],
      fieldsToFlatten: [],
    })
  })

  const forest = await Forest.init({
    // configDir: join(__dirname, './forest/forest'),
    envSecret: process.env.FOREST_ENV_SECRET,
    authSecret: process.env.FOREST_AUTH_SECRET,
    schemaDir: process.env.FOREST_SCHEMA_DIR,
    objectMapping: Mongoose,
    includedModels: connection.modelNames(),
    // includedModels: models,
    connections: { default: connection },
  })
  app.use(forest)

```

---

<div class="post-metadata">

**Author:** ![Anthony\_Wentzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/anthony_wentzel/32/4141_2.png) [@Anthony\_Wentzel](https://community.forestadmin.com/u/Anthony_Wentzel)\
**Post date:** [March 1, 2022, 8:18pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/2 "2022-03-01T20:18:18Z")

</div>

> [@Anthony\_Wentzel](#):
>
> > - or remove this section if left empty.

Failure Logs:

chunk.8.0ef465b663b809cf1743.js:1 GET [http://localhost:3310/forest/Source/62045768be659c3a4205f267?timezone=America%2FLos\_Angeles](http://localhost:3310/forest/Source/62045768be659c3a4205f267?timezone=America%2FLos_Angeles) 404 (Not Found)  
(anonymous) @ chunk.8.0ef465b663b809cf1743.js:1  
(anonymous) @ chunk.8.0ef465b663b809cf1743.js:1  
send @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:48  
ajax @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:48  
\_ajaxRequest @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:149  
\_ajax @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:149  
(anonymous) @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:149  
(anonymous) @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
x @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
ajax @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:149  
(anonymous) @ client-f8c55ff26b26addedbdee95220b1137e.js:1  
Promise.then (async)  
ajax @ client-f8c55ff26b26addedbdee95220b1137e.js:1  
findRecord @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:149  
(anonymous) @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:149  
v @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
(anonymous) @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
invoke @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
flush @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
flush @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
\_end @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
end @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
\_run @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
\_join @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
join @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
h @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
(anonymous) @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
a @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
handleEvent @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
handleEvent @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
(anonymous) @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:58  
dispatch @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:48  
g.handle @ vendor-56f6d5c2818e6c53ba88479381c34a73.js:48  
chunk.8.0ef465b663b809cf1743.js:1 [forest] 🌳🌳🌳 Unexpected error in details view: n {isAdapterError: true, stack: ‘Error: Ember Data Request GET [http://localhost:331](http://localhost:331)…m/assets/chunk.8.0ef465b663b809cf1743.js:1:45893)’, description: undefined, fileName: undefined, lineNumber: undefined, …}  
(anonymous) @ chunk.8.0ef465b663b809cf1743.js:1

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [March 2, 2022, 9:34am UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/3 "2022-03-02T09:34:31Z")

</div>

Hi @Anthony_Wentzel,

I’m sorry to hear that. I do not reproduce on my end.  
Could you please share the mongo request that is generated ?

---

<div class="post-metadata">

**Author:** ![Anthony\_Wentzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/anthony_wentzel/32/4141_2.png) [@Anthony\_Wentzel](https://community.forestadmin.com/u/Anthony_Wentzel)\
**Post date:** [March 2, 2022, 2:22pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/4 "2022-03-02T14:22:02Z")

</div>

@anon62739609 How do I log the mongo request? Is there a debug flag?

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [March 2, 2022, 2:44pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/5 "2022-03-02T14:44:22Z")

</div>

As you can see [here](https://stackoverflow.com/questions/18762264/log-all-queries-that-mongoose-fire-in-the-application), it seems you just need to do:

```javascript
mongoose.set('debug', true);

```

---

<div class="post-metadata">

**Author:** ![Anthony\_Wentzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/anthony_wentzel/32/4141_2.png) [@Anthony\_Wentzel](https://community.forestadmin.com/u/Anthony_Wentzel)\
**Post date:** [March 2, 2022, 4:54pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/6 "2022-03-02T16:54:26Z")

</div>

Ok here’s the debug:

```javascript
POST /forest/authentication 200 1041 - 25.343 ms
OPTIONS /forest/authentication/callback?code=ugCk0UG1T28YHV6XyfyikeCXLPK7KYbMSCOfJcurY5eGspRYP4bmn9cBFzmFMSi7&state=%7B%22renderingId%22%3A116333%7D 200 8 - 12.838 ms
GET /forest/authentication/callback?code=ugCk0UG1T28YHV6XyfyikeCXLPK7KYbMSCOfJcurY5eGspRYP4bmn9cBFzmFMSi7&state=%7B%22renderingId%22%3A116333%7D 200 550 - 1288.225 ms
sources.aggregate [{"$group":{"_id":null,"count":{"$sum":1}}}] {}
GET /forest/Source/count?fields%5BSource%5D=_id%2CcreatedAt%2Cname%2CpublisherId%2CupdatedAt%2Curl&fields%5BpublisherId%5D=name&timezone=America%2FLos_Angeles 304 - - 1337.198 ms
sources.aggregate [{"$sort":{"_id":-1}},{"$skip":0},{"$limit":15}] {}
GET /forest/Source?timezone=America%2FLos_Angeles&fields%5BSource%5D=_id%2CcreatedAt%2Cname%2CpublisherId%2CupdatedAt%2Curl&fields%5BpublisherId%5D=name&page%5Bnumber%5D=1&page%5Bsize%5D=15&sort=-_id 304 - - 1599.601 ms
sources.aggregate [{"$match":{"$and":[{"_id":"62045768be659c3a4205f267"}]}},{"$group":{"_id":null,"count":{"$sum":1}}}] {}
GET /forest/Source/62045768be659c3a4205f267?timezone=America%2FLos_Angeles 404 113 - 1763.474 ms
sources.aggregate [{"$match":{"$and":[{"_id":"62045768be659c3a4205f267"}]}},{"$group":{"_id":null,"count":{"$sum":1}}}] {}
GET /forest/Source/62045768be659c3a4205f267?timezone=America%2FLos_Angeles 404 113 - 114.697 ms

```

Looks like forest-express-mongoose is not finding the records. When I tap the detail I don’t see any mongo query… it’s almost like the express route does not exist

---

<div class="post-metadata">

**Author:** ![anon37903635](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@anon37903635](https://community.forestadmin.com/u/anon37903635)\
**Post date:** [March 3, 2022, 8:56am UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/7 "2022-03-03T08:56:50Z")

</div>

Yo @Anthony_Wentzel 👋

Can you share the model definition of the collection `Sources` ?

---

<div class="post-metadata">

**Author:** ![Anthony\_Wentzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/anthony_wentzel/32/4141_2.png) [@Anthony\_Wentzel](https://community.forestadmin.com/u/Anthony_Wentzel)\
**Post date:** [March 7, 2022, 6:49pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/8 "2022-03-07T18:49:46Z")

</div>

Yes,

```javascript
import { Exclude } from 'class-transformer'
import { Model, ObjectId } from 'mongoose'

import { Field, ObjectType } from '@nestjs/graphql'
import { DocumentType, index, modelOptions, prop } from '@typegoose/typegoose'

import { BaseSchema } from '../core/data'
import { ObjectIdScalar } from '../core/utils/graphql.utils'
import { Createable, Lookupable } from '../core/utils/types.utils'

const schemaOptions = {
  collection: 'sources',
  timestamps: true,
}

// Sources are the individual streams of content that we’d be pulling from. Publishers may have multiple sources. Sources will need a URL from where we’ll fetch data.
// - Fields
// - Name
// - URL
// - Functionalities
// - Relationships
// - Belongs to a Publisher
// - Has many Feeds
// - Has many Communities through Feeds

@modelOptions({
  // options: {
  // automaticName: false,
  // customName: (options) => `${options.schemaOptions?.collection}`,
  // },
  schemaOptions: schemaOptions,
})
@index({ url: 1 })
@ObjectType()
export class Source extends BaseSchema {
  @Field()
  @Exclude()
  @prop({ default: '' })
  public name: string

  @Field()
  @prop({ default: '' })
  public url: string

  @Field(() => ObjectIdScalar)
  @prop({ required: true, ref: 'Publisher' })
  public publisherId: ObjectId
}

export type CreateableSource = Createable<Source>
export type PartialSource = Partial<Source>
export type FetchableSource = Lookupable<Source>
export type SourceDocument = DocumentType<Source>
export type SourceModel = Model<SourceDocument>
export type SourceRepository = SourceModel

```

I’ve tried forcing the collection name “sources” to match the model name. But the default collection is “sources” and model name is “Source”

Would you like me to zip you the entire project to help?

Thank you!

---

<div class="post-metadata">

**Author:** ![anon37903635](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@anon37903635](https://community.forestadmin.com/u/anon37903635)\
**Post date:** [March 8, 2022, 9:46am UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/10 "2022-03-08T09:46:01Z")

</div>

> [@Anthony\_Wentzel](#):
>
> Would you like me to zip you the entire project to help?

Sure. Can you send it to me via `Message`?

Can you post also your `BaseSchema` here?  
Do you encounter this issue on all your `environments` or only on `dev`?  
What version of `mongoose`/`mongo` are you using?

---

<div class="post-metadata">

**Author:** ![Anthony\_Wentzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/anthony_wentzel/32/4141_2.png) [@Anthony\_Wentzel](https://community.forestadmin.com/u/Anthony_Wentzel)\
**Post date:** [March 10, 2022, 2:51pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/11 "2022-03-10T14:51:00Z")

</div>

@anon37903635 Yes, I sent you a message with link

---

<div class="post-metadata">

**Author:** ![anon37903635](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@anon37903635](https://community.forestadmin.com/u/anon37903635)\
**Post date:** [March 10, 2022, 3:17pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/12 "2022-03-10T15:17:48Z")

</div>

Yup, I’m already on it 💪, cheers. I’ll keep you posted

---

<div class="post-metadata">

**Author:** ![Anthony\_Wentzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/anthony_wentzel/32/4141_2.png) [@Anthony\_Wentzel](https://community.forestadmin.com/u/Anthony_Wentzel)\
**Post date:** [March 10, 2022, 3:49pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/13 "2022-03-10T15:49:54Z")

</div>

Great thank you, happy to help or make whatever changes are needed.

---

<div class="post-metadata">

**Author:** ![Anthony\_Wentzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/anthony_wentzel/32/4141_2.png) [@Anthony\_Wentzel](https://community.forestadmin.com/u/Anthony_Wentzel)\
**Post date:** [March 14, 2022, 4:49pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/14 "2022-03-14T16:49:54Z")

</div>

@anon37903635 any updates here?

---

<div class="post-metadata">

**Author:** ![anon37903635](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@anon37903635](https://community.forestadmin.com/u/anon37903635)\
**Post date:** [March 14, 2022, 5:03pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/15 "2022-03-14T17:03:32Z")

</div>

@Anthony_Wentzel Not yet, unfortunately 🙁  
I’ll reach out to some of my colleagues for their opinions on the matter.

I’ll alert you as soon as I find something 💪🌲

---

<div class="post-metadata">

**Author:** ![anon37903635](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@anon37903635](https://community.forestadmin.com/u/anon37903635)\
**Post date:** [March 17, 2022, 10:24am UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/16 "2022-03-17T10:24:50Z")

</div>

@Anthony_Wentzel Yo 👋

The issue is still being discussed among us.  
In the meantime, here’s a couple of my leads: 🔍

- Before performing the request against the database, are you casting the `ID` to `ObjectId`?
- The call between the frontend and the backend targets `/forest/Source`? Is that correct? Shouldn’t it be `/forest/sources`?

You might want to take a look at [this thread](https://community.forestadmin.com/t/relationship-references-are-empty-on-table-view-after-v5-v8-migration/4234). 🧐  
Also, what’s the intent with this project architecture? Or what is the use case you are trying to do?

**EDIT** : One of our team will organize a live debug session with you, stay tuned 💪🌲

---

<div class="post-metadata">

**Author:** ![Anthony\_Wentzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/anthony_wentzel/32/4141_2.png) [@Anthony\_Wentzel](https://community.forestadmin.com/u/Anthony_Wentzel)\
**Post date:** [March 17, 2022, 3:00pm UTC](https://community.forestadmin.com/t/record-details-not-displaying/4281/17 "2022-03-17T15:00:09Z")

</div>

Yes, I agree.

Currently, I do not downcast as the forest-express-mongoose is handling all the routes.

I’ve tried it both ways… using the actual model name and setting the collection name for the model.

forest-express-mongoose does throw a warning if we try to use the “sources” (the collection name) versus the actual model name “Source”
