Duplicated Presentation when using mongoose
See original GitHub issueI have a feathers service that I can test with postman, and it shows a list of 4 records all distinct. However, when I try to use it with aor-feathers-client, no matter which model I use, the records are all being presented as equal. So let’s say for example, we have a model for reminders
. We would expect:
Reminders List
- reminder 1
- reminder 2
- …
But what is appearing is:
Reminder List
- reminder 1
- reminder 1
- …
Where the first item is always duplicated. Also, when trying to edit, it simply passes ‘undefined’. I’m not sure what I’m doing wrong here. I based it entirely off of your example:
// App.js
import React from 'react';
import { Admin, Resource, simpleRestClient } from 'admin-on-rest';
import { RemindersList} from './Reminders';
import { restClient } from 'aor-feathers-client'; // authClient for future!
import feathersClient from './feathersClient';
const App = () => (
<Admin restClient={restClient(feathersClient)}>
<Resource name="reminders" list={ContactList} />
</Admin>
);
export default App;
// Contact.js
import React from 'react';
import { Filter, DisabledInput, ReferenceInput, List, Edit, Create, SimpleForm, Datagrid, TextField, SelectInput, TextInput, EditButton } from 'admin-on-rest/lib/mui';
export const RemindersList = (props) => (
<List {...props}>
<Datagrid>
<TextField source="_id" />
<TextField source="credoId" />
<TextField source="surveyId" />
<TextField source="frequency" />
<TextField source="nextReminder" />
<EditButton />
</Datagrid>
</List>
);
// feathersClient.js
import feathers from 'feathers-client';
import hooks from 'feathers-hooks';
import rest from 'feathers-rest/client';
const host = 'http://localhost:3030';
export default feathers()
.configure(hooks())
.configure(rest(host).fetch(window.fetch.bind(window)));
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Duplicate data getting added into collection - MongoDB
Hi, I have created a mongoose model as below, and set recordId field to “unique: true” to handle duplicate entry. But when through...
Read more >node.js to check out duplication value in mongoose
As you see I need to use count method whether the value is duplicated or not. I don't want to use count method...
Read more >Handling Mongoose Dublication Errors - DEV Community
my logic here is when I am using create function I will insert a new option which is some keys to check if...
Read more >Mongoose v6.8.2: FAQ
A. The most common cause of duplicate queries is mixing callbacks and promises with queries. That's because passing a callback to a query...
Read more >Mongoose 101: An Introduction to the Basics, Subdocuments ...
Mongoose adds a new character to the database each time you use new Character and save . If you run the code(s) above...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
check here:
https://github.com/feathersjs/feathers-mongoose/issues/81 https://github.com/feathersjs/feathers-mongoose/issues/156
@fonzarely Is working to support custom id (maybe you want to help) https://github.com/josx/aor-feathers-client/pull/21
It seems to be that you are using mongo or somehting with custom id field name. We are working to support that! @thngdude if you can please help us! here WIP https://github.com/josx/aor-feathers-client/pull/21 (need tests, and @1beb told us that it is not working )