These are chat archives for Automattic/mongoose

Jun 2018
Jun 09 2018 04:44

Can anyone give me suggestion?
I need to get the users owned uploaded images but i don't have a image model, i only have a Status model like this

const StatusSchema = new Schema({
   status_images: {
        type: Array,
        required: true
    status_description: {
        type: String,
    status_by: {
        type: Schema.Types.ObjectId, ref: 'Account',
        required: true
    status_date: {
        type: Date, 

As you can see there is a status_images property , so i'm thinking on just querying the Status Schema to find and get only the status_images instead of building another Model for the images but is this ideal?

Here's an example of saved data

    "_id": {
        "$oid": "5b0cffba349fff03c7afba16"
    "status_images": [
    "status_description": "get to know",
    "status_by": {
        "$oid": "5af16d60f3957c11e46500ae"
    "status_date": {
        "$date": "2018-04-14T07:22:34.224Z"
    "__v": 1
Jun 09 2018 07:42
@2HexGFX_twitter if your image is a simple string that holds an URL - then why do you need another schema?
i would fetch them directly from the status_images instead of another schema.