Select using a external collection
See original GitHub issueIf possible how could you populate a select
(options property) with an external Mongo collection?
Here’s what I’ve tried so far:
import { Mongo } from 'meteor/mongo'
import Schema from 'simpl-schema'
import {api as PeopleApi} from './People' // a mongo collection
const peopleData = PeopleApi.find({}).fetch().map(obj => obj['name'])
export const api = new Mongo.Collection('Service')
export const schema = new Schema({
name: {
type: String,
optional: false,
label: 'Name'
},
person: {
type: String,
allowedValues: [...peopleData]
},
active: {
type: Boolean,
label: 'Active',
defaultValue: true
}
})
export default api
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
External Collections - Duda Support
Click + New Collection, and select External Database. Type the Endpoint URL and click Fetch collection. Click Continue. Type a name for the...
Read more >Use Microsoft Query to retrieve external data
To set up a data source by using Microsoft Query: On the Data tab, in the Get External Data group, click From Other...
Read more >Velo: Adding and Deleting an External Database Collection
To add an external collection: In the Velo sidebar click the plus sign next to Database and select Add External Collections.
Read more >Adalo External User Collection Beta - Xano Community
I have been attempting to complete the external database and user authentication connection using Xano and Adalo.
Read more >Formulas—ArcGIS Survey123 | Documentation
Use formulas to create smarter forms with Survey123. ... Returns the number of selected answers for select_one and select_multiple questions.
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
@caiobep allowedValues (and most of the props) can be a function, which is then executed each time the allowedValues array is needed. (You can also call
.map
directly afterfind()
without the fetch.)Obviously you’ll need to make sure the PeopleApi subscription is ready before you validate if this is in client code.
Ah, in which case it may be because .find().fetch() returns a promise and isn’t resolved when you create the schema.