Keys in mongodb can't contain nulls, so that's not going to work to create an index anyway... I'd like to get the length back, and added a comment to the smart_str part of this patch.