1.

Which of the following returns a substring of a string?(a) $subs(b) $substring(c) $substr(d) None of the mentionedThis question was addressed to me at a job interview.Origin of the question is Pipeline and Sharded Collections in section Aggregation Concepts and Aggregation Mechanics of MongoDB

Answer»

Right option is (c) $substr

For explanation: $substr accepts three expressions as arguments: the first ARGUMENT must resolve to a STRING, and the SECOND and third arguments must resolve to INTEGERS.



Discussion

No Comment Found

Related InterviewSolutions