Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: $concatArrays with $cond #12058

Closed
2 tasks done
Marsup opened this issue Jul 6, 2022 · 0 comments
Closed
2 tasks done

types: $concatArrays with $cond #12058

Marsup opened this issue Jul 6, 2022 · 0 comments
Labels
typescript Types or Types-test related issue / Pull Request
Milestone

Comments

@Marsup
Copy link

Marsup commented Jul 6, 2022

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

6.4.3

Node.js version

16

MongoDB server version

N/A

Description

Very similarly to #12017, ConcatArrays doesn't allow $cond

Steps to Reproduce

import type { Expression } from 'mongoose';

const concat: Expression.ConcatArrays = {
    $concatArrays: [
        {
            $cond: {
                if: { $eq: ['foo', true] },
                then: [1],
                else: [2]
            }
        }
    ]
}

Playground link: https://www.typescriptlang.org/play?ssl=13&ssc=2&pln=1&pc=1#code/JYWwDg9gTgLgBDAnmApnA3nAogDzFFAZ0OAgDs4BfOAMyghDgHIRyBzCCQlJgbgCh+AY3KF4IskICGMAFzY8BYqTIA6AMLlpMAIJQoUxITgBeDPziW4AEgna9Bo-IDaFq+-Rv33mxIAm8p4+wVbANIE2KACOLkw0nEwANAhQAK4oALpUiV4h3jAAFihkLgCMGTl5wSgANtwuAEwZuSGULVZt7s2UQA

Expected Behavior

It should build without error

@vkarpov15 vkarpov15 added this to the 6.4.5 milestone Jul 11, 2022
@vkarpov15 vkarpov15 added the typescript Types or Types-test related issue / Pull Request label Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

No branches or pull requests

2 participants